Author: Matti Picus <matti.pi...@gmail.com> Branch: py3.6 Changeset: r96068:c3304e7116ad Date: 2019-02-18 16:06 +0200 http://bitbucket.org/pypy/pypy/changeset/c3304e7116ad/
Log: merge default into branch diff --git a/lib_pypy/cffi.egg-info/PKG-INFO b/lib_pypy/cffi.egg-info/PKG-INFO --- a/lib_pypy/cffi.egg-info/PKG-INFO +++ b/lib_pypy/cffi.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: cffi -Version: 1.12.0 +Version: 1.12.1 Summary: Foreign Function Interface for Python calling C code. Home-page: http://cffi.readthedocs.org Author: Armin Rigo, Maciej Fijalkowski 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 @@ -38,6 +38,15 @@ self._utf8 = utf8str self._length = length self._index_storage = rutf8.null_storage() + if not we_are_translated(): + try: + # best effort, too expensive to handle surrogates + ulength = len(utf8str.decode('utf8')) + except: + ulength = length + assert ulength == length + + @staticmethod def from_utf8builder(builder): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit