[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree, a ValueError may be better than OverflowError, but all other formattings raise OverflowError, and we should support them consistent. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed __

[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset f8ede55cf92b by Serhiy Storchaka in branch '3.3': Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise http://hg.python.org/cpython/rev/f8ede55cf92b New changeset 42def600210e by Serhiy Storchaka in branch 'default': Issue #181

[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No, I don't feel motivated right now (and this is a case when even never is better than right now). I checked other format methods and found a bug only in PyUnicode_FromFormatV(). I had added test for 3.3+ because 3.3+ already have a test for PyUnicode_From

[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-18 Thread STINNER Victor
STINNER Victor added the comment: Both patches look good to me. Do you feel motivated to check if all formating methods have a test? Here is a list of format methods: PyUnicode_Format(): - 3.3, 3.4: formatchar() raises OverflowError if x > MAX_UNICODE - 2.7: formatchar() raises OverflowError if

[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-10 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file30536/format_c-2.7.diff ___ Python tracker ___ ___ Python-bugs-list maili

[issue18184] Add range check for %c in PyUnicode_FromFormat

2013-06-10 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently PyUnicode_FromFormat doesn't check an argument for %c and can raise SystemError only due maxchar check in PyUnicode_New. On 2.7 an error doesn't raised, but %c argument can be silently wrapped (on narrow build) or illegal Unicode string can be cr