bpo-31825: Fixed OverflowError in the 'unicode-escape' codec (GH-4058) (#4059)

and in codecs.escape_decode() when decode an escaped non-ascii byte.
(cherry picked from commit 56cb465cc9)
This commit is contained in:
Miss Islington (bot) 2017-10-20 07:41:29 -07:00 committed by Serhiy Storchaka
parent 9c23b173b8
commit 1e78ed6825
5 changed files with 9 additions and 3 deletions

View file

@ -4127,7 +4127,7 @@ decode_utf8(struct compiling *c, const char **sPtr, const char *end)
static int
warn_invalid_escape_sequence(struct compiling *c, const node *n,
char first_invalid_escape_char)
unsigned char first_invalid_escape_char)
{
PyObject *msg = PyUnicode_FromFormat("invalid escape sequence \\%c",
first_invalid_escape_char);