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

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


http://hg.python.org/cpython/rev/d8c2ce63f5a4
changeset:   81742:d8c2ce63f5a4
parent:      81740:513b728695fc
parent:      81741:dcbc16afd6bc
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Fri Jan 25 23:53:29 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
@@ -10,6 +10,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
@@ -5598,7 +5598,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