summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-12-02 16:20:28 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-12-02 16:20:28 (GMT)
commit47a00f3d1a1fe3774d92e5d9263ef3bff79dd4ac (patch)
tree4aaec1d69dd4b4a28e615ee90ef081264d100c4b /Lib
parentaff472394cf29c7712854043fbac6a032195fe77 (diff)
downloadcpython-47a00f3d1a1fe3774d92e5d9263ef3bff79dd4ac.zip
cpython-47a00f3d1a1fe3774d92e5d9263ef3bff79dd4ac.tar.gz
cpython-47a00f3d1a1fe3774d92e5d9263ef3bff79dd4ac.tar.bz2
support encoding error handlers that return bytes (closes #16585)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_multibytecodec.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py
index feb7bd5..7b47cb5 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: