[issue19969] PyBytes_FromFormatV("%c") and PyString_FromFormatV("%c") don't check for character min/max value

STINNER Victor report at bugs.python.org
Fri Dec 13 15:01:46 CET 2013


STINNER Victor added the comment:

It was easy to fix the issue on Python 3.3 (there are already unit tests on PyBytes_FromFormatV).

I prefer to leave Python 2.7 with it's current behaviour because applications running on Python 2.7 may be old and might be rely on the integer overflow. PyString is the native "string" type, so it is usually used. Whereas in Python 3, bytes is not the native type. I chose to fix Python 3.3 because it's a recent release and I believe that applications are more recent and if they rely on the bug, they can more easily fixed.

(Ok, I bet that in practice, nobody cares of non-ASCII characters in PyBytes_FromFormatV() because PyBytes_FromFormatV() is probably not used in the wild.)

So let close this minor issue.

----------
resolution:  -> fixed
status: open -> closed

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


More information about the Python-bugs-list mailing list