summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:53:29 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-25 21:53:29 (GMT)
commit570c5b235451412ac55ce211813358b50d0e070b (patch)
tree467734a5d9f80d60e7cbc76f5d553b016b94d80e
parentf584aba3a506e72a59e2e834bc56a6e97f4ab4dd (diff)
parent73e38809e01113ca586056eaf603737c60b1009e (diff)
downloadcpython-570c5b235451412ac55ce211813358b50d0e070b.zip
cpython-570c5b235451412ac55ce211813358b50d0e070b.tar.gz
cpython-570c5b235451412ac55ce211813358b50d0e070b.tar.bz2
Issue #16980: Fix processing of escaped non-ascii bytes in the
unicode-escape-decode decoder.
-rw-r--r--Misc/NEWS3
-rw-r--r--Objects/unicodeobject.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index af4ae6a..68544a4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 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 15c284f..5030e8d 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -5598,7 +5598,7 @@ PyUnicode_DecodeUnicodeEscape(const char *s,
}
else {
WRITECHAR('\\');
- WRITECHAR(s[-1]);
+ WRITECHAR((unsigned char)s[-1]);
}
break;
}