New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_json: fix raise_errmsg(), py_encode_basestring_ascii() and linecol() #47873
Comments
_json module of python 3.0 has some bugs. (a) [_json.c] raise_errmsg() calls json.decoder.errmsg() from Python >>> import _json
>>> _json.scanstring(b"xxx", 1, "xxx")
Erreur de segmentation (core dumped) => json.decoder.errmsg() calls linecol() which raise an error on (b) [_json.c] py_encode_basestring_ascii() calls PyBytes_Check(rval) >>> 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 |
That patch looks ok to me, but I'm not at all familiar with the changes in |
Christian, I believe, did the original 3.0 porting, so he can probably |
Deferring until rc2 |
bpo-3763 mentions about the similar problem with json library. File "C:\Python30\lib\json\decoder.py", line 30, in errmsg |
Hum, here is a part of my patch which can be applied to python 2.6. I |
_json26.patch looks good, and is necessary, because the called python I would just add another minor change: this raise_errmsg() function |
I applied the changes proposed in _json26.patch to simplejson and they |
The patch looks good to me. You may want to fix the refleak in the PyList_Append() calls (I counted if (PyList_Append(chunks, chunk)) {
goto bail;
} should be: if (PyList_Append(chunks, chunk)) {
Py_DECREF(chunk);
goto bail;
} Also, line 384 and 548: Py_DECREF(chunks);
chunks = NULL; should changed to Py_CLEAR(chunks); |
Fixed in r66932 and r66934. |
Refleak was fixed in r66934. |
I mean r66938. Sorry! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: