mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
support encoding error handlers that return bytes (closes #16585)
This commit is contained in:
parent
aff472394c
commit
47a00f3d1a
3 changed files with 13 additions and 2 deletions
|
@ -45,6 +45,10 @@ class Test_MultibyteCodec(unittest.TestCase):
|
|||
self.assertRaises(IndexError, dec,
|
||||
b'apple\x92ham\x93spam', 'test.cjktest')
|
||||
|
||||
def test_errorhandler_returns_bytes(self):
|
||||
enc = "\u30fb\udc80".encode('gb18030', 'surrogateescape')
|
||||
self.assertEqual(enc, b'\x819\xa79\x80')
|
||||
|
||||
def test_codingspec(self):
|
||||
try:
|
||||
for enc in ALL_CJKENCODINGS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue