Author: hyeshik.chang Date: Fri Jun 23 23:16:18 2006 New Revision: 47086 Modified: python/trunk/Misc/NEWS python/trunk/Python/codecs.c Log: Bug #1511381: codec_getstreamcodec() in codec.c is corrected to omit a default "error" argument for NULL pointer. This allows the parser to take a codec from cjkcodecs again. (Reported by Taewook Kang and reviewed by Walter Doerwald) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri Jun 23 23:16:18 2006 @@ -12,6 +12,9 @@ Core and builtins ----------------- +- Bug #1511381: codec_getstreamcodec() in codec.c is corrected to + omit a default "error" argument for NULL pointer. This allows + the parser to take a codec from cjkcodecs again. Library ------- Modified: python/trunk/Python/codecs.c ============================================================================== --- python/trunk/Python/codecs.c (original) +++ python/trunk/Python/codecs.c Fri Jun 23 23:16:18 2006 @@ -249,14 +249,17 @@ const char *errors, const int index) { - PyObject *codecs, *streamcodec; + PyObject *codecs, *streamcodec, *codeccls; codecs = _PyCodec_Lookup(encoding); if (codecs == NULL) return NULL; - streamcodec = PyEval_CallFunction( - PyTuple_GET_ITEM(codecs, index), "Os", stream, errors); + codeccls = PyTuple_GET_ITEM(codecs, index); + if (errors != NULL) + streamcodec = PyObject_CallFunction(codeccls, "Os", stream, errors); + else + streamcodec = PyObject_CallFunction(codeccls, "O", stream); Py_DECREF(codecs); return streamcodec; }
On 6/23/06, hyeshik.chang <python-checkins@python.org> wrote:
Author: hyeshik.chang Date: Fri Jun 23 23:16:18 2006 New Revision: 47086
Modified: python/trunk/Misc/NEWS python/trunk/Python/codecs.c Log: Bug #1511381: codec_getstreamcodec() in codec.c is corrected to omit a default "error" argument for NULL pointer. This allows the parser to take a codec from cjkcodecs again. (Reported by Taewook Kang and reviewed by Walter Doerwald)
Can we get a test case for this? n
On 7/6/06, Neal Norwitz <nnorwitz@gmail.com> wrote:
On 6/23/06, hyeshik.chang <python-checkins@python.org> wrote:
Author: hyeshik.chang Date: Fri Jun 23 23:16:18 2006 New Revision: 47086
Modified: python/trunk/Misc/NEWS python/trunk/Python/codecs.c Log: Bug #1511381: codec_getstreamcodec() in codec.c is corrected to omit a default "error" argument for NULL pointer. This allows the parser to take a codec from cjkcodecs again. (Reported by Taewook Kang and reviewed by Walter Doerwald)
Can we get a test case for this?
Added. Thank you for reminding me. :) Hye-Shik
participants (3)
-
Hye-Shik Chang -
hyeshik.chang -
Neal Norwitz