From 73e38809e01113ca586056eaf603737c60b1009e Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 25 Jan 2013 23:52:21 +0200 Subject: [PATCH] Issue #16980: Fix processing of escaped non-ascii bytes in the unicode-escape-decode decoder. --- Misc/NEWS | 3 +++ Objects/unicodeobject.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS b/Misc/NEWS index 34e01a4ce01..9d12d88e984 100644 --- 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" diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index c30245d9f82..a2ddf3e578f 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5725,7 +5725,7 @@ PyUnicode_DecodeUnicodeEscape(const char *s, } else { WRITECHAR('\\'); - WRITECHAR(s[-1]); + WRITECHAR((unsigned char)s[-1]); } break; }