[pypy-commit] pypy py3.5: OS/X translation fix (with jit)

arigo pypy.commits at gmail.com
Mon Mar 13 09:47:08 EDT 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r90649:45fabe7ba733
Date: 2017-03-13 14:46 +0100
http://bitbucket.org/pypy/pypy/changeset/45fabe7ba733/

Log:	OS/X translation fix (with jit)

diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py
--- a/pypy/interpreter/unicodehelper.py
+++ b/pypy/interpreter/unicodehelper.py
@@ -48,9 +48,10 @@
                               force_ignore=False)[0]
     elif _MACOSX:
         bytes = space.bytes_w(w_string)
-        uni = runicode.str_decode_utf_8(
-            bytes, len(bytes), 'surrogateescape',
-            errorhandler=state.decode_error_handler)[0]
+        uni = runicode.str_decode_utf_8_impl(
+            bytes, len(bytes), 'surrogateescape', final=True,
+            errorhandler=state.decode_error_handler,
+            allow_surrogates=False)[0]
     elif space.sys.filesystemencoding is None or state.codec_need_encodings:
         # bootstrap check: if the filesystemencoding isn't initialized
         # or the filesystem codec is implemented in Python we cannot
@@ -77,9 +78,10 @@
                                     force_replace=False)
     elif _MACOSX:
         uni = space.unicode_w(w_uni)
-        bytes = runicode.unicode_encode_utf_8(
+        bytes = runicode.unicode_encode_utf_8_impl(
             uni, len(uni), 'surrogateescape',
-            errorhandler=state.encode_error_handler)
+            errorhandler=state.encode_error_handler,
+            allow_surrogates=False)
     elif space.sys.filesystemencoding is None or state.codec_need_encodings:
         # bootstrap check: if the filesystemencoding isn't initialized
         # or the filesystem codec is implemented in Python we cannot


More information about the pypy-commit mailing list