New submission from Dustin Boswell:
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\", ''' *
1 + '\"asd
Dustin Boswell added the comment:
Here's a slightly smaller/cleaner test case that only requires 12GB of ram to
run:
python -c "import simplejson as json; json.loads('[' + '''\"...\", ''' *
2 + '0]') "
Dustin Boswell added the comment:
I thought simplejson was a standard module for 2.6, and got renamed to json
(replacing the older json module) in later versions.
For instance, I get the same problem with 2.7 (no simplejson):
python2.7 -c "import json; json.
Dustin Boswell added the comment:
Python 2.7.3 (default, Aug 3 2012, 20:01:21)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys;print("%x" %
Dustin Boswell added the comment:
Yes, bug exists on 3.1 (gcc build), as well as darwin build of 2.7:
python3.1 -c "import json; json.loads('[%22s' % ']')"
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/py