[pypy-commit] pypy py3k: translation fixes for win32
mattip
noreply at buildbot.pypy.org
Fri Jul 31 14:51:55 CEST 2015
Author: mattip <matti.picus at gmail.com>
Branch: py3k
Changeset: r78726:7ed46662d44e
Date: 2015-07-31 15:51 +0300
http://bitbucket.org/pypy/pypy/changeset/7ed46662d44e/
Log: translation fixes for win32
diff --git a/pypy/module/posix/interp_posix.py b/pypy/module/posix/interp_posix.py
--- a/pypy/module/posix/interp_posix.py
+++ b/pypy/module/posix/interp_posix.py
@@ -524,7 +524,9 @@
# started through main() instead of wmain()
rwin32._wgetenv(u"")
for key, value in rwin32._wenviron_items():
- space.setitem(w_env, space.wrap(key.upper()), space.wrap(value))
+ if isinstance(key, str):
+ key = key.upper()
+ space.setitem(w_env, space.wrap(key), space.wrap(value))
@unwrap_spec(name=unicode, value=unicode)
def putenv(space, name, value):
diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py
--- a/rpython/rlib/runicode.py
+++ b/rpython/rlib/runicode.py
@@ -1,7 +1,7 @@
import sys
from rpython.rlib.objectmodel import specialize, we_are_translated
from rpython.rlib.rstring import StringBuilder, UnicodeBuilder
-from rpython.rlib.rarithmetic import r_uint, intmask
+from rpython.rlib.rarithmetic import r_uint, intmask, widen
from rpython.rlib.unicodedata import unicodedb
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rlib import jit
@@ -74,7 +74,7 @@
else:
def code_to_unichr(code):
# generate surrogates for large codes
- return unichr_returns_surrogate(code)
+ return unichr_returns_surrogate(widen(code))
def _STORECHAR(result, CH, byteorder):
hi = chr(((CH) >> 8) & 0xff)
More information about the pypy-commit
mailing list