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
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
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
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.
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:
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