cpython: 050772822bde (original) (raw)

Mercurial > cpython

changeset 73554:050772822bde 2.7

Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder already accepts them). [#13333]

Antoine Pitrou solipsis@pitrou.net
date Tue, 15 Nov 2011 01:49:40 +0100
parents 555871844962
children e277fe8380e0
files Lib/test/test_unicode.py Misc/NEWS Objects/unicodeobject.c
diffstat 3 files changed, 19 insertions(+), 12 deletions(-)[+] [-] Lib/test/test_unicode.py 14 Misc/NEWS 3 Objects/unicodeobject.c 14

line wrap: on

line diff

--- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -771,10 +771,18 @@ class UnicodeTest( for (x, y) in utfTests: self.assertEqual(x.encode('utf-7'), y)

# Direct encoded characters set_d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?"

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -9,6 +9,9 @@ What's New in Python 2.7.3? Core and Builtins ----------------- +- Issue #13333: The UTF-7 decoder now accepts lone surrogates (the encoder

--- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1628,21 +1628,17 @@ PyObject *PyUnicode_DecodeUTF7Stateful(c *p++ = outCh; #endif surrogate = 0;

@@ -1652,8 +1648,8 @@ PyObject *PyUnicode_DecodeUTF7Stateful(c inShift = 0; s++; if (surrogate) {