From 47a00f3d1a1fe3774d92e5d9263ef3bff79dd4ac Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sun, 2 Dec 2012 11:20:28 -0500 Subject: support encoding error handlers that return bytes (closes #16585) --- Lib/test/test_multibytecodec.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Lib/test') diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py index feb7bd595a..7b47cb50e8 100644 --- a/Lib/test/test_multibytecodec.py +++ b/Lib/test/test_multibytecodec.py @@ -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: -- cgit v1.2.1