Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise

OverflowError when an argument of %c format is out of range.
This commit is contained in:
Serhiy Storchaka 2013-06-23 20:21:16 +03:00
commit c89533f72f
3 changed files with 6 additions and 1 deletions

View file

@ -2048,6 +2048,8 @@ class UnicodeTest(string_tests.CommonTest,
b'%c', c_int(0xabcd))
check_format('\U0010ffff',
b'%c', c_int(0x10ffff))
with self.assertRaises(OverflowError):
PyUnicode_FromFormat(b'%c', c_int(0x110000))
# Issue #18183
check_format('\U00010000\U00100000',
b'%c%c', c_int(0x10000), c_int(0x100000))