This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Dustin.Boswell, ezio.melotti, pitrou, serhiy.storchaka, vstinner
Date 2012-12-01.21:29:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1354397368.97.0.608293545738.issue16586@psf.upfronthosting.co.za>
In-reply-to
Content
Actually, this isn't a problem in _json.c but in the re library: JSONDecoder.raw_decode() works fine, but JSONDecoder.decode() raises:

$ ./python -c "import json.decoder; print(json.decoder.JSONDecoder().raw_decode('[%2200000000s' % ']'))"
([], 2200000001)

$ ./python -c "import json.decoder; print(json.decoder.JSONDecoder().decode('[%2200000000s' % ']'))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/antoine/cpython/default/Lib/json/decoder.py", line 347, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column -2094967295 - line 1 column 2200000001 (char -2094967295 - 2200000001)


(decode() is basically raw_decode() followed by a call to WHITESPACE.match() from the end of the JSON object:
http://hg.python.org/cpython/file/2c04d2102534/Lib/json/decoder.py#l339
)
History
Date User Action Args
2012-12-01 21:29:29pitrousetrecipients: + pitrou, vstinner, ezio.melotti, serhiy.storchaka, Dustin.Boswell
2012-12-01 21:29:28pitrousetmessageid: <1354397368.97.0.608293545738.issue16586@psf.upfronthosting.co.za>
2012-12-01 21:29:28pitroulinkissue16586 messages
2012-12-01 21:29:28pitroucreate