summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-06-23 17:12:14 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-06-23 17:12:14 (GMT)
commit8eeae2126ca7dd91ae6f10443eda1af5338bccf7 (patch)
tree33ec8ddfbb4c5152de7d1645ef26691e77132596 /Lib/test
parent36a7e4f74a7fdf193f0fd0fab8ace602bca490a5 (diff)
downloadcpython-8eeae2126ca7dd91ae6f10443eda1af5338bccf7.zip
cpython-8eeae2126ca7dd91ae6f10443eda1af5338bccf7.tar.gz
cpython-8eeae2126ca7dd91ae6f10443eda1af5338bccf7.tar.bz2
Issue #18184: PyUnicode_FromFormat() and PyUnicode_FromFormatV() now raise
OverflowError when an argument of %c format is out of range.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_unicode.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 2e30145..0c82560 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -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)),