mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
bpo-22602: Raise an exception in the UTF-7 decoder for ill-formed sequences starting with "+". (GH-8741)
The UTF-7 decoder now raises UnicodeDecodeError for ill-formed sequences starting with "+" (as specified in RFC 2152).
This commit is contained in:
parent
d3d3171da8
commit
e349bf2358
4 changed files with 13 additions and 0 deletions
|
@ -1020,6 +1020,7 @@ class UTF7Test(ReadTest, unittest.TestCase):
|
|||
(b'a+////,+IKw-b', 'a\uffff\ufffd\u20acb'),
|
||||
(b'a+IKw-b\xff', 'a\u20acb\ufffd'),
|
||||
(b'a+IKw\xffb', 'a\u20ac\ufffdb'),
|
||||
(b'a+@b', 'a\ufffdb'),
|
||||
]
|
||||
for raw, expected in tests:
|
||||
with self.subTest(raw=raw):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue