[pypy-commit] pypy unicode-utf8-py3: off-by-one error

mattip pypy.commits at gmail.com
Mon Oct 22 02:00:23 EDT 2018


Author: Matti Picus <matti.picus at gmail.com>
Branch: unicode-utf8-py3
Changeset: r95231:8c089ffd30f2
Date: 2018-10-22 08:49 +0300
http://bitbucket.org/pypy/pypy/changeset/8c089ffd30f2/

Log:	off-by-one error

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
@@ -1216,7 +1216,7 @@
             ru, pos = eh(errors, "utf8", "surrogates not allowed", utf8,
                 pos, pos + 1)
             upos = rutf8.next_codepoint_pos(utf8,pos)
-            end = utf8[upos+1:]
+            end = utf8[upos:]
             utf8 = start + ru + end
             w_object = space.newtext(utf8)
     if errors is None or errors == 'strict':


More information about the pypy-commit mailing list