[pypy-commit] pypy py3.6: use lenght in codepoints not utf8

mattip pypy.commits at gmail.com
Mon Feb 18 10:07:45 EST 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r96064:a2c4c9f78c7a
Date: 2019-02-18 15:05 +0200
http://bitbucket.org/pypy/pypy/changeset/a2c4c9f78c7a/

Log:	use lenght in codepoints not utf8

diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -507,11 +507,13 @@
                         result = str(value)
                         lgt += len(result)
                     elif fmt == 'R':
-                        result = space.utf8_w(space.repr(value))
-                        lgt += len(result)
+                        s = space.repr(value)
+                        result = space.utf8_w(s)
+                        lgt += space.len_w(s)
                     elif fmt == 'S':
-                        result = space.utf8_w(space.str(value))
-                        lgt += len(result)
+                        s = space.str(value)
+                        result = space.utf8_w(s)
+                        lgt += space.len_w(s)
                     elif fmt == 'T':
                         result = space.type(value).name
                         lgt += len(result)


More information about the pypy-commit mailing list