Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73e3880

Browse files
Issue #16980: Fix processing of escaped non-ascii bytes in the
unicode-escape-decode decoder.
1 parent e58785b commit 73e3880

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ What's New in Python 3.3.1?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #16980: Fix processing of escaped non-ascii bytes in the
16+
unicode-escape-decode decoder.
17+
1518
- Issue #16975: Fix error handling bug in the escape-decode bytes decoder.
1619

1720
- Issue #14850: Now a charmap decoder treats U+FFFE as "undefined mapping"

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5725,7 +5725,7 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
57255725
}
57265726
else {
57275727
WRITECHAR('\\');
5728-
WRITECHAR(s[-1]);
5728+
WRITECHAR((unsigned char)s[-1]);
57295729
}
57305730
break;
57315731
}

0 commit comments

Comments
 (0)