diff Lib/test/test_codecs.py @ 62367:283d9472df4e

Issue #850997: mbcs encoding (Windows only) handles errors argument: strict mode raises unicode errors. The encoder only supports "strict" and "replace" error handlers, the decoder only supports "strict" and "ignore" error handlers.
author Victor Stinner <victor.stinner@haypocalc.com>
date Wed, 16 Jun 2010 23:33:54 +0000
parents 7576260d1b65
children 1d1797af4622
line wrap: on
line diff
--- a/Lib/test/test_codecs.py	Wed Jun 16 23:05:06 2010 +0000
+++ b/Lib/test/test_codecs.py	Wed Jun 16 23:33:54 2010 +0000
@@ -1358,11 +1358,6 @@
     "idna",
 ]
 
-# The following encodings only support "strict" mode
-only_strict_mode = [
-    "idna",
-]
-
 class BasicUnicodeTest(unittest.TestCase, MixInCheckStateHandling):
     def test_basics(self):
         s = "abc123" # all codecs should be able to encode these
@@ -1437,7 +1432,7 @@
                     result = "".join(codecs.iterdecode(codecs.iterencode("", encoding), encoding))
                     self.assertEqual(result, "")
 
-                if encoding not in only_strict_mode:
+                if encoding not in ("idna", "mbcs"):
                     # check incremental decoder/encoder with errors argument
                     try:
                         encoder = codecs.getincrementalencoder(encoding)("ignore")