diff options
author | Hye-Shik Chang <hyeshik@gmail.com> | 2009-04-02 10:33:16 (GMT) |
---|---|---|
committer | Hye-Shik Chang <hyeshik@gmail.com> | 2009-04-02 10:33:16 (GMT) |
commit | 944820b044ce3944dcef1b514e075118f6872942 (patch) | |
tree | 4bb9c95bc039e479a750d616bafa227fa9e64ff3 /Lib/test/test_multibytecodec.py | |
parent | a3d056ed95ff45dbd8abd90f3f816e7953214d80 (diff) | |
download | cpython-944820b044ce3944dcef1b514e075118f6872942.zip cpython-944820b044ce3944dcef1b514e075118f6872942.tar.gz cpython-944820b044ce3944dcef1b514e075118f6872942.tar.bz2 |
Issue #5640: Fix _multibytecodec so that CJK codecs don't repeat
error replacement returned by codec error callbacks twice in
IncrementalEncoder and StreamWriter.
Diffstat (limited to 'Lib/test/test_multibytecodec.py')
-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 2f64867..1d9d9e35 100644 --- a/Lib/test/test_multibytecodec.py +++ b/Lib/test/test_multibytecodec.py @@ -112,6 +112,10 @@ class Test_IncrementalEncoder(unittest.TestCase): self.assertRaises(UnicodeEncodeError, encoder.encode, '\u0123') self.assertEqual(encoder.encode('', True), b'\xa9\xdc') + def test_issue5640(self): + encoder = codecs.getincrementalencoder('shift-jis')('backslashreplace') + self.assertEqual(encoder.encode('\xff'), b'\\xff') + self.assertEqual(encoder.encode('\n'), b'\n') class Test_IncrementalDecoder(unittest.TestCase): |