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

2013-12-13 Thread STINNER Victor
STINNER Victor added the comment: Updated patch for Serhiy's remark (replace ValueError with OverflowError). -- Added file: http://bugs.python.org/file33116/bytes_fromformat_c-2.patch ___ Python tracker rep...@bugs.python.org

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

2013-12-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- assignee: - haypo stage: - commit review type: - behavior versions: +Python 2.7, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19969

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

2013-12-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 68e0dbc492de by Victor Stinner in branch '3.3': Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if %c http://hg.python.org/cpython/rev/68e0dbc492de New changeset 969e38b2f336 by Victor Stinner in branch 'default': (Merge 3.3) Issue

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

2013-12-13 Thread STINNER Victor
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.

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

2013-12-12 Thread STINNER Victor
New submission from STINNER Victor: PyBytes_FromFormatV(%c) and PyString_FromFormatV(%c) overflow if the parameter is not in range [0; 255]. If nobody complained before, it's maybe not worth to fix the bug in Python 2.7 or 3.3. -- components: Interpreter Core messages: 205996 nosy:

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

2013-12-12 Thread STINNER Victor
STINNER Victor added the comment: Here is a patch for Python 3.4. -- keywords: +patch nosy: +serhiy.storchaka Added file: http://bugs.python.org/file33108/bytes_fromformat_c.patch ___ Python tracker rep...@bugs.python.org