Issue #15379: Fix passing of non-BMP characters as integers for the charmap decoder (already working as unicode strings).

Patch by Serhiy Storchaka.
This commit is contained in:
Antoine Pitrou 2012-11-17 21:14:58 +01:00
parent 1df43d33d2
commit e3ae321222
4 changed files with 135 additions and 3 deletions

View file

@ -717,7 +717,7 @@ class CodecCallbackTest(unittest.TestCase):
raise ValueError
self.assertRaises(UnicodeError, codecs.charmap_decode, "\xff", "strict", {0xff: None})
self.assertRaises(ValueError, codecs.charmap_decode, "\xff", "strict", D())
self.assertRaises(TypeError, codecs.charmap_decode, "\xff", "strict", {0xff: sys.maxunicode+1})
self.assertRaises(TypeError, codecs.charmap_decode, "\xff", "strict", {0xff: 0x110000})
def test_encodehelper(self):
# enhance coverage of: