[pypy-issue] Issue #2345: pypy json.loads fails on a string, on which CPython doesn't (Unpaired high surrogate) (pypy/pypy)

bra issues-reply at bitbucket.org
Thu Jul 14 09:59:37 EDT 2016


New issue 2345: pypy json.loads fails on a string, on which CPython doesn't (Unpaired high surrogate)
https://bitbucket.org/pypy/pypy/issues/2345/pypy-jsonloads-fails-on-a-string-on-which

bra:

Hi,

I have this funny looking JSON:
js='{"subject":"\xc3\x9aj tev\xc3\xa9kenys\xc3\xa9g a vide\xc3\xb3ddal kapcsolatban: UGORJ M\xc3\x81R!!! / Yellow : The Yellow Artifact","snippet":"\xc3\x9aj tev\xc3\xa9kenys\xc3\xa9g a vide\xc3\xb3ddal kapcsolatban: Videos DB megjegyz\xc3\xa9st \xc3\xadrt ehhez: \\r\\nUGORJ M\xc3\x81R!!! / Yellow : The Yellow Artifact nem t\xc3\xb6lt le a szaros Evolve \\r\\nStage\\uD83D\\uDE24\\uD83D\\uDE26\\uD83D"}'

I can json.loads this from CPython, and can't from pypy:
Python 2.7.11 (default, Jun 18 2016, 01:18:18) 
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> json.loads(js)
{u'snippet': u'\xdaj tev\xe9kenys\xe9g a vide\xf3ddal kapcsolatban: Videos DB megjegyz\xe9st \xedrt ehhez: \r\nUGORJ M\xc1R!!! / Yellow : The Yellow Artifact nem t\xf6lt le a szaros Evolve \r\nStage\U0001f624\U0001f626\ud83d', u'subject': u'\xdaj tev\xe9kenys\xe9g a vide\xf3ddal kapcsolatban: UGORJ M\xc1R!!! / Yellow : The Yellow Artifact'}

Python 2.7.10 (b0a649e90b6642251fb4a765fe5b27a97b1319a9, May 12 2016, 01:17:56)
[PyPy 5.1.1 with GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>>> json.loads(js)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/pypy-5.1/lib-python/2.7/json/__init__.py", line 344, in loads
    return _pypyjson.loads(s)
ValueError: Unpaired high surrogate at char 311





More information about the pypy-issue mailing list