Author: Matti Picus <[email protected]>
Branch: 
Changeset: r96228:ead9c5bf9d9c
Date: 2019-03-09 20:43 +0200
http://bitbucket.org/pypy/pypy/changeset/ead9c5bf9d9c/

Log:    change test of utf8 length, len(u) != codepoints on narrow builds

diff --git a/pypy/objspace/std/unicodeobject.py 
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -44,7 +44,7 @@
         if not we_are_translated():
             try:
                 # best effort, too expensive to handle surrogates
-                ulength = len(utf8str.decode('utf8'))
+                ulength = rutf8.codepoints_in_utf(utf8str)
             except:
                 ulength = length 
             assert ulength == length
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to