[issue9058] PyUnicodeDecodeError_Create asserts that various arguments are less than INT_MAX

Dave Malcolm report at bugs.python.org
Tue Jun 22 20:14:31 CEST 2010


Dave Malcolm <dmalcolm at redhat.com> added the comment:

Patch to remove the restriction that the fields be < INT_MAX

Tested on x86_64 on a machine with > 12GB of RAM, leads to this exception, rather than the python process bailing out:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Lib/encodings/utf_16.py", line 16, in decode
    return codecs.utf_16_decode(input, errors, True)
UnicodeDecodeError: 'utf16' codec can't decode byte 0x41 in position 2147483646: truncated data

I'm not sure about automated testing for this; the reproducer seems to need >=12GB of RAM - in borderline cases it drives my machine deep into swap, which can take a long time to recover from, and might be unacceptable in the test suite.

----------
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file17746/remove-PyUnicodeDecodeError_Create-assertions-issue9058.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9058>
_______________________________________


More information about the Python-bugs-list mailing list