[Python-checkins] cpython (3.3): Issue #16980: Fix processing of escaped non-ascii bytes in the

serhiy.storchaka python-checkins at python.org
Fri Jan 25 22:54:39 CET 2013


http://hg.python.org/cpython/rev/dcbc16afd6bc
changeset:   81741:dcbc16afd6bc
branch:      3.3
parent:      81739:580d536cc910
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jan 25 23:52:21 2013 +0200
summary:
  Issue #16980: Fix processing of escaped non-ascii bytes in the
unicode-escape-decode decoder.

files:
  Misc/NEWS               |  3 +++
  Objects/unicodeobject.c |  2 +-
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,9 @@
 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"
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5725,7 +5725,7 @@
             }
             else {
                 WRITECHAR('\\');
-                WRITECHAR(s[-1]);
+                WRITECHAR((unsigned char)s[-1]);
             }
             break;
         }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list