diff options
author | Walter Dörwald <walter@livinglogic.de> | 2005-08-30 10:23:14 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2005-08-30 10:23:14 (GMT) |
commit | a47d1c08d0911f2f49d92b8c6035593a672af436 (patch) | |
tree | b89cf4f689e9037da807a5e2509d87715d64057f /Modules | |
parent | 523c9f0709d5e7af4d45817b92cf5ce01609269c (diff) | |
download | cpython-a47d1c08d0911f2f49d92b8c6035593a672af436.zip cpython-a47d1c08d0911f2f49d92b8c6035593a672af436.tar.gz cpython-a47d1c08d0911f2f49d92b8c6035593a672af436.tar.bz2 |
SF bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
about illegal code points. The codec now supports PEP 293 style error handlers.
(This is a variant of the Nik Haldimann's patch that detects truncated data)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_codecsmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c index a6c42b1..3441f61 100644 --- a/Modules/_codecsmodule.c +++ b/Modules/_codecsmodule.c @@ -254,8 +254,8 @@ unicode_internal_decode(PyObject *self, else { if (PyObject_AsReadBuffer(obj, (const void **)&data, &size)) return NULL; - return codec_tuple(PyUnicode_FromUnicode((Py_UNICODE *)data, - size / sizeof(Py_UNICODE)), + + return codec_tuple(_PyUnicode_DecodeUnicodeInternal(data, size, errors), size); } } |