mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
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)
This commit is contained in:
parent
523c9f0709
commit
a47d1c08d0
6 changed files with 173 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue