mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#16336: fix input checking in the surrogatepass error handler. Patch by Serhiy Storchaka.
This commit is contained in:
parent
8af179e744
commit
540da76115
3 changed files with 9 additions and 4 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue