mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
(Merge 3.3) Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if
"%c" argument is not in range [0; 255].
This commit is contained in:
commit
507ac3a591
3 changed files with 25 additions and 3 deletions
|
@ -743,6 +743,12 @@ class BytesTest(BaseBytesTest, unittest.TestCase):
|
|||
self.assertEqual(PyBytes_FromFormat(b's:%s', c_char_p(b'cstr')),
|
||||
b's:cstr')
|
||||
|
||||
# Issue #19969
|
||||
self.assertRaises(OverflowError,
|
||||
PyBytes_FromFormat, b'%c', c_int(-1))
|
||||
self.assertRaises(OverflowError,
|
||||
PyBytes_FromFormat, b'%c', c_int(256))
|
||||
|
||||
|
||||
class ByteArrayTest(BaseBytesTest, unittest.TestCase):
|
||||
type2test = bytearray
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue