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
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue