Message176760
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
) |
|
Date |
User |
Action |
Args |
2012-12-01 21:29:29 | pitrou | set | recipients:
+ pitrou, vstinner, ezio.melotti, serhiy.storchaka, Dustin.Boswell |
2012-12-01 21:29:28 | pitrou | set | messageid: <1354397368.97.0.608293545738.issue16586@psf.upfronthosting.co.za> |
2012-12-01 21:29:28 | pitrou | link | issue16586 messages |
2012-12-01 21:29:28 | pitrou | create | |
|