]> granicus.if.org Git - python/commitdiff
Issue #16980: Fix processing of escaped non-ascii bytes in the
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 25 Jan 2013 21:52:21 +0000 (23:52 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 25 Jan 2013 21:52:21 +0000 (23:52 +0200)
unicode-escape-decode decoder.

Misc/NEWS
Objects/unicodeobject.c

index 34e01a4ce01b903180e26adfd78945984aacdb3b..9d12d88e9840699c215c58eb5d2f88b534300291 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@ What's New in Python 3.3.1?
 Core and Builtins
 -----------------
 
+- Issue #16980: Fix processing of escaped non-ascii bytes in the
+  unicode-escape-decode decoder.
+
 - Issue #16975: Fix error handling bug in the escape-decode bytes decoder.
 
 - Issue #14850: Now a charmap decoder treats U+FFFE as "undefined mapping"
index c30245d9f82fa0785dd1102539ceaf98415314cd..a2ddf3e578f8f4e4b58d213dfb5ef8a5b906acef 100644 (file)
@@ -5725,7 +5725,7 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
             }
             else {
                 WRITECHAR('\\');
-                WRITECHAR(s[-1]);
+                WRITECHAR((unsigned char)s[-1]);
             }
             break;
         }