[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Uh, this is issue10182. Indeed, the patch there seems to fix it. -- resolution: -> duplicate stage: needs patch -> committed/rejected status: open -> closed superseder: -> match_start truncates large values ___ P

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Uh, this is issue10182. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: 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('[%22s' % ']'))" ([], 220001) $

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: As Antoine Pitrou reported on IRC, this bug exists on 3.x. Sorry, but this bug can't be fixed on 2.6 and 3.1. -- versions: +Python 3.2, Python 3.3, Python 3.4 -Python 3.1 ___ Python tracker

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Dustin Boswell
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/python3.1/json/__init__.py", line 293, in loads retur

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Dustin Boswell
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" % sys.maxsize, sys.maxsize > 2**32) ('7fff', True) -- _

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Dustin, what version of 2.7 do you use? What "python2.7 -V" says? Please someone run on self-built 64-bit Python 2.7 something like (this should require a little greater than 2GB of memory): python -c "import json; json.loads('[%22s' % ']')" I sus

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file28172/json_size_t_cleanup-2.7.patch ___ Python tracker ___ ___ Python-b

[issue16586] json library can't parse large (> 2^31) strings

2012-12-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file28171/json_size_t_cleanup.patch ___ Python tracker ___ ___ Python-bugs-

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Dustin Boswell
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.loads('[' + '''\"...\", ''' * 20

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ahem... I just noticed: import simplejson as json Dustin, this is not Python issue, this is simplejson issue. Can you reproduce the bug with standard json module? Try something like '[%*s]' % (2**32, ''), this should require less memory (especially on 3

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Issue16009 has an effect on error messages. But this error message should not be. scan_once() returns a 32-bit overflowed index (994967285 == 330011 - 2**32). However all indices in Modules/_json.c are of type Py_ssize_t. -- ___

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Dustin Boswell
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]') " Traceback (most recent call last): File "", line 1, in File "/usr/lib/pymo

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Ezio Melotti
Ezio Melotti added the comment: Even if the json module can't handle these values, the error message can be improved. Serhiy, does you patch have any effect on the error message? -- nosy: +ezio.melotti type: crash -> behavior ___ Python tracker

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I saw nothing that could lead to a bug, except a few of the obsolete functions for work with size_t (for compatibility with versions <2.6). Here is a patch that gets rid of this outdated code. I don't have enough memory to check if this will help, but I thin

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue16586] json library can't parse large (> 2^31) strings

2012-11-30 Thread Dustin Boswell
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 + '\"asdfasf\"]') " That works, but if you increase the size a little bit (so t