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 vstinner
Recipients vstinner
Date 2008-08-20.22:58:43
SpamBayes Score 1.0418651e-09
Marked as misclassified No
Message-id <1219273124.72.0.104841129313.issue3623@psf.upfronthosting.co.za>
In-reply-to
Content
_json module of python 3.0 has some bugs.

(a) [_json.c] raise_errmsg() calls json.decoder.errmsg() from Python 
module, but this function may fails. If it fails, error should be be 
set to NULL. Example:

>>> import _json
>>> _json.scanstring(b"xxx", 1, "xxx")
Erreur de segmentation (core dumped)

=> json.decoder.errmsg() calls linecol() which raise an error on 
b"xxx".index("\n").

(b) [_json.c] py_encode_basestring_ascii() calls PyBytes_Check(rval) 
but rval can be NULL if ascii_escape_str() or ascii_escape_unicode() 
fails. Example:

>>> import _json
>>> _json.encode_basestring_ascii(b"xx\xff")
Erreur de segmentation (core dumped)

(c) [Lib/json/decoder.py] linecol() doesn't support bytes, but it's 
called with bytes argument: see point (a). For an example, see point 
(a).
History
Date User Action Args
2008-08-20 22:58:44vstinnersetrecipients: + vstinner
2008-08-20 22:58:44vstinnersetmessageid: <1219273124.72.0.104841129313.issue3623@psf.upfronthosting.co.za>
2008-08-20 22:58:44vstinnerlinkissue3623 messages
2008-08-20 22:58:43vstinnercreate