mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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:
commit
c89533f72f
3 changed files with 6 additions and 1 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue