mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #8949: "z" format of PyArg_Parse*() functions doesn't accept bytes
objects, as described in the documentation.
This commit is contained in:
parent
2f7105dde7
commit
4aae1ebab2
3 changed files with 4 additions and 6 deletions
|
@ -325,7 +325,7 @@ class Bytes_TestCase(unittest.TestCase):
|
|||
from _testcapi import getargs_z
|
||||
self.assertEqual(getargs_z('abc\xe9'), b'abc\xc3\xa9')
|
||||
self.assertRaises(TypeError, getargs_z, 'nul:\0')
|
||||
self.assertEqual(getargs_z(b'bytes'), b'bytes')
|
||||
self.assertRaises(TypeError, getargs_z, b'bytes')
|
||||
self.assertRaises(TypeError, getargs_z, bytearray(b'bytearray'))
|
||||
self.assertRaises(TypeError, getargs_z, memoryview(b'memoryview'))
|
||||
self.assertIsNone(getargs_z(None))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue