cpython: ddfcb0de564f (original) (raw)

Mercurial > cpython

changeset 73552:ddfcb0de564f 3.2

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:42:21 +0100
parents 16ed15ff0d7c
children 250091e60f28 a00bb30cf775
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 @@ -1091,10 +1091,18 @@ class UnicodeTest(string_tests.CommonTes for (x, y) in utfTests: self.assertEqual(x.encode('utf-7'), y)

# Issue #2242: crash on some Windows/MSVC versions self.assertEqual(b'+\xc1'.decode('utf-7'), '\xc1')

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

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

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