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 Dustin.Boswell
Recipients Dustin.Boswell
Date 2012-11-30.21:40:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1354311645.71.0.363130090165.issue16586@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a command-line that parses a json string containing a large array of short strings:

python -c "import simplejson as json; json.loads('[' + '''\"asdfadf\", ''' * 100000000 + '\"asdfasf\"]') "

That works, but if you increase the size a little bit (so the string is > 2^31)

python -c "import simplejson as json; json.loads('[' + '''\"asdfadf\", ''' * 300000000 + '\"asdfasf\"]') "

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/simplejson/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/pymodules/python2.6/simplejson/decoder.py", line 338, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column -994967285 - line 1 column 3300000011 (char -994967285 - 3300000011)


Here's my version:

$ python
Python 2.6.5 (r265:79063, Oct  1 2012, 22:04:36) 
[GCC 4.4.3] on linux2
>>> import sys;print("%x" % sys.maxsize, sys.maxsize > 2**32)
('7fffffffffffffff', True)


Also note that the test above requires at least 20GB of memory (that's not a bug, just a heads-up).
History
Date User Action Args
2012-11-30 21:40:45Dustin.Boswellsetrecipients: + Dustin.Boswell
2012-11-30 21:40:45Dustin.Boswellsetmessageid: <1354311645.71.0.363130090165.issue16586@psf.upfronthosting.co.za>
2012-11-30 21:40:45Dustin.Boswelllinkissue16586 messages
2012-11-30 21:40:44Dustin.Boswellcreate