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:
Serhiy Storchaka 2017-10-20 17:08:15 +03:00 committed by GitHub
parent 525f40d231
commit 56cb465cc9
5 changed files with 9 additions and 3 deletions

View file

@ -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