Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95337:6eeefdec5c2e
Date: 2018-11-18 01:04 -0800
http://bitbucket.org/pypy/pypy/changeset/6eeefdec5c2e/
Log: return value from encode errorhandler is bytes, not unicode
diff --git a/pypy/interpreter/unicodehelper.py
b/pypy/interpreter/unicodehelper.py
--- a/pypy/interpreter/unicodehelper.py
+++ b/pypy/interpreter/unicodehelper.py
@@ -277,11 +277,11 @@
msg = "ordinal not in range(256)"
res_8, newindex = errorhandler(
errors, 'latin1', msg, s, startindex, index)
- for cp in rutf8.Utf8StringIterator(res_8):
- if cp > 0xFF:
+ for ch in res_8:
+ if ord(ch) > 0xFF:
errorhandler("strict", 'latin1', msg, s, startindex, index)
raise RuntimeError('error handler should not have
returned')
- result.append(chr(cp))
+ result.append(ch)
if index != newindex: # Should be uncommon
index = newindex
pos = rutf8._pos_at_index(s, newindex)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit