Author: Armin Rigo <[email protected]>
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
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to