diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-21 22:50:28 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-05-21 22:50:28 (GMT) |
commit | d6703b5e38baac6b85c1c2cf9311e11e4916984b (patch) | |
tree | 5cb3fb2d2ae8fe340ed8a89b9b1fc3896b7bcb50 /Lib | |
parent | fa0fdb89e98fbbec7da9891dde2647fb951888c8 (diff) | |
download | cpython-d6703b5e38baac6b85c1c2cf9311e11e4916984b.zip cpython-d6703b5e38baac6b85c1c2cf9311e11e4916984b.tar.gz cpython-d6703b5e38baac6b85c1c2cf9311e11e4916984b.tar.bz2 |
Issue #5640: Fix Shift-JIS incremental encoder for error handlers different
than strict
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_multibytecodec.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py index 517a682..95ca0ab 100644 --- a/Lib/test/test_multibytecodec.py +++ b/Lib/test/test_multibytecodec.py @@ -107,6 +107,10 @@ class Test_IncrementalEncoder(unittest.TestCase): self.assertRaises(UnicodeEncodeError, encoder.encode, u'\u0123') self.assertEqual(encoder.encode(u'', True), '\xa9\xdc') + def test_issue5640(self): + encoder = codecs.getincrementalencoder('shift-jis')('backslashreplace') + self.assertEqual(encoder.encode(u'\xff'), b'\\xff') + self.assertEqual(encoder.encode(u'\n'), b'\n') class Test_IncrementalDecoder(unittest.TestCase): |