#16336: fix input checking in the surrogatepass error handler. Patch by Serhiy Storchaka.

This commit is contained in:
Ezio Melotti 2012-11-03 23:03:39 +02:00
parent 8af179e744
commit 540da76115
3 changed files with 9 additions and 4 deletions

View file

@ -647,6 +647,8 @@ class UTF8Test(ReadTest):
self.assertTrue(codecs.lookup_error("surrogatepass"))
with self.assertRaises(UnicodeDecodeError):
b"abc\xed\xa0".decode("utf-8", "surrogatepass")
with self.assertRaises(UnicodeDecodeError):
b"abc\xed\xa0z".decode("utf-8", "surrogatepass")
class UTF7Test(ReadTest):
encoding = "utf-7"