diff options
Diffstat (limited to 'lib-python/2.7/test/test_multibytecodec.py')
-rw-r--r-- | lib-python/2.7/test/test_multibytecodec.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib-python/2.7/test/test_multibytecodec.py b/lib-python/2.7/test/test_multibytecodec.py index 9fb0e9d227..0057543ce6 100644 --- a/lib-python/2.7/test/test_multibytecodec.py +++ b/lib-python/2.7/test/test_multibytecodec.py @@ -43,6 +43,13 @@ class Test_MultibyteCodec(unittest.TestCase): self.assertRaises((IndexError, OverflowError), dec, 'apple\x92ham\x93spam', 'test.cjktest') + def test_errorcallback_custom_ignore(self): + # Issue #23215: MemoryError with custom error handlers and multibyte codecs + data = 100 * unichr(0xdc00) + codecs.register_error("test.ignore", codecs.ignore_errors) + for enc in ALL_CJKENCODINGS: + self.assertEqual(data.encode(enc, "test.ignore"), b'') + def test_codingspec(self): for enc in ALL_CJKENCODINGS: code = '# coding: {}\n'.format(enc) @@ -72,7 +79,7 @@ class Test_IncrementalEncoder(unittest.TestCase): self.assertEqual(encoder.reset(), None) def test_stateful(self): - # jisx0213 encoder is stateful for a few codepoints. eg) + # jisx0213 encoder is stateful for a few code points. eg) # U+00E6 => A9DC # U+00E6 U+0300 => ABC4 # U+0300 => ABDC |