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

@ -1257,7 +1257,7 @@ PyObject *PyBytes_DecodeEscape(const char *s,
if (first_invalid_escape != NULL) {
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
"invalid escape sequence '\\%c'",
*first_invalid_escape) < 0) {
(unsigned char)*first_invalid_escape) < 0) {
Py_DECREF(result);
return NULL;
}