diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-18 19:55:25 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-18 19:55:25 (GMT) |
commit | 9e92188f53b89bef01824c061650908baddb8e16 (patch) | |
tree | 36676cea6890861ff93c44d2bdf3ffa3015967ce /Lib/test/test_codecs.py | |
parent | 62be4fb21f88037b59a47f85a138928ea6be794b (diff) | |
download | cpython-9e92188f53b89bef01824c061650908baddb8e16.zip cpython-9e92188f53b89bef01824c061650908baddb8e16.tar.gz cpython-9e92188f53b89bef01824c061650908baddb8e16.tar.bz2 |
Issue #12281: Fix test_codecs.test_cp932() on Windows XP
Cool! Decoding b'\x81\x00abc' from cp932 with replace error handler is now
giving the same result on all Windows versions.
Diffstat (limited to 'Lib/test/test_codecs.py')
-rw-r--r-- | Lib/test/test_codecs.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 45522fc..fa257b8 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -1810,7 +1810,7 @@ class CodePageTest(unittest.TestCase): ('[\xff]', 'replace', b'[y]'), ('[\u20ac]', 'replace', b'[?]'), )) - tests = [ + self.check_decode(932, ( (b'abc', 'strict', 'abc'), (b'\x82\x84\xe9\x80', 'strict', '\uff44\u9a3e'), # invalid bytes @@ -1819,12 +1819,8 @@ class CodePageTest(unittest.TestCase): (b'\xff', 'replace', '\ufffd'), (b'\x81\x00abc', 'strict', None), (b'\x81\x00abc', 'ignore', '\x00abc'), - ] - if self.vista_or_later(): - tests.append((b'\x81\x00abc', 'replace', '\ufffd\x00abc')) - else: - tests.append((b'\x81\x00abc', 'replace', '\x00\x00abc')) - self.check_decode(932, tests) + (b'\x81\x00abc', 'replace', '\ufffd\x00abc'), + )) def test_cp1252(self): self.check_encode(1252, ( |