mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (#4058)
and in codecs.escape_decode() when decode an escaped non-ascii byte.
This commit is contained in:
parent
525f40d231
commit
56cb465cc9
5 changed files with 9 additions and 3 deletions
|
@ -1203,6 +1203,8 @@ class EscapeDecodeTest(unittest.TestCase):
|
|||
check(br"\8", b"\\8")
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
check(br"\9", b"\\9")
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
check(b"\\\xfa", b"\\\xfa")
|
||||
|
||||
def test_errors(self):
|
||||
decode = codecs.escape_decode
|
||||
|
@ -2474,6 +2476,8 @@ class UnicodeEscapeTest(unittest.TestCase):
|
|||
check(br"\8", "\\8")
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
check(br"\9", "\\9")
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
check(b"\\\xfa", "\\\xfa")
|
||||
|
||||
def test_decode_errors(self):
|
||||
decode = codecs.unicode_escape_decode
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue