[pypy-commit] pypy unicode-utf8: fix

arigo pypy.commits at gmail.com
Fri Oct 13 09:10:30 EDT 2017


Author: Armin Rigo <arigo at tunes.org>
Branch: unicode-utf8
Changeset: r92743:b9d04d54fecd
Date: 2017-10-13 08:38 +0200
http://bitbucket.org/pypy/pypy/changeset/b9d04d54fecd/

Log:	fix

diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py
--- a/pypy/module/_codecs/interp_codecs.py
+++ b/pypy/module/_codecs/interp_codecs.py
@@ -487,7 +487,8 @@
 @unwrap_spec(data='bufferstr', errors='text_or_none', byteorder=int,
              w_final=WrappedDefault(False))
 def utf_16_ex_decode(space, data, errors='strict', byteorder=0, w_final=None):
-    assert False, "fix in the future"
+    from pypy.interpreter.unicodehelper import DecodeWrapper
+
     if errors is None:
         errors = 'strict'
     final = space.is_true(w_final)
@@ -502,14 +503,16 @@
     if final:
         consumed = 0
     res, consumed, byteorder = runicode.str_decode_utf_16_helper(
-        data, len(data), errors, final, state.decode_error_handler, byteorder)
+        data, len(data), errors, final,
+        DecodeWrapper(state.decode_error_handler).handle, byteorder)
     return space.newtuple([space.newunicode(res), space.newint(consumed),
                            space.newint(byteorder)])
 
 @unwrap_spec(data='bufferstr', errors='text_or_none', byteorder=int,
              w_final=WrappedDefault(False))
 def utf_32_ex_decode(space, data, errors='strict', byteorder=0, w_final=None):
-    assert False, "fix in the future"
+    from pypy.interpreter.unicodehelper import DecodeWrapper
+
     final = space.is_true(w_final)
     state = space.fromcache(CodecState)
     if byteorder == 0:
@@ -522,7 +525,8 @@
     if final:
         consumed = 0
     res, consumed, byteorder = runicode.str_decode_utf_32_helper(
-        data, len(data), errors, final, state.decode_error_handler, byteorder)
+        data, len(data), errors, final,
+        DecodeWrapper(state.decode_error_handler).handle, byteorder)
     return space.newtuple([space.newunicode(res), space.newint(consumed),
                            space.newint(byteorder)])
 


More information about the pypy-commit mailing list