summaryrefslogtreecommitdiffstats
path: root/Modules/_codecsmodule.c
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2005-08-30 10:23:14 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2005-08-30 10:23:14 (GMT)
commita47d1c08d0911f2f49d92b8c6035593a672af436 (patch)
treeb89cf4f689e9037da807a5e2509d87715d64057f /Modules/_codecsmodule.c
parent523c9f0709d5e7af4d45817b92cf5ce01609269c (diff)
downloadcpython-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/_codecsmodule.c')
-rw-r--r--Modules/_codecsmodule.c4
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);
}
}