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:
parent
36a7e4f74a
commit
8eeae2126c
3 changed files with 12 additions and 2 deletions
|
@ -2024,6 +2024,8 @@ class UnicodeTest(string_tests.CommonTest,
|
|||
# test "%c"
|
||||
self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0xabcd)), '\uabcd')
|
||||
self.assertEqual(PyUnicode_FromFormat(b'%c', c_int(0x10ffff)), '\U0010ffff')
|
||||
with self.assertRaises(OverflowError):
|
||||
PyUnicode_FromFormat(b'%c', c_int(0x110000))
|
||||
# Issue #18183
|
||||
self.assertEqual(
|
||||
PyUnicode_FromFormat(b'%c%c', c_int(0x10000), c_int(0x100000)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue