mirror of
https://github.com/python/cpython.git
synced 2025-11-20 10:57:44 +00:00
Add a NEWS entry for r81758 and clarify a comment.
This commit is contained in:
parent
e57e50c8e7
commit
ab2eb0ee84
2 changed files with 11 additions and 3 deletions
|
|
@ -670,9 +670,9 @@ class UnicodeTest(
|
||||||
('\xF4'+cb+'\xBF\xBF').decode, 'utf-8')
|
('\xF4'+cb+'\xBF\xBF').decode, 'utf-8')
|
||||||
|
|
||||||
def test_issue8271(self):
|
def test_issue8271(self):
|
||||||
# Issue #8271: when a byte sequence is invalid, only the start byte
|
# Issue #8271: during the decoding of an invalid UTF-8 byte sequence,
|
||||||
# and all the valid continuation bytes should be replaced by U+FFFD,
|
# only the start byte and the continuation byte(s) are now considered
|
||||||
# not the number of bytes specified by the start byte.
|
# invalid, instead of the number of bytes specified by the start byte.
|
||||||
# See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf (page 95,
|
# See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf (page 95,
|
||||||
# table 3-8, Row 2) for more information about the algorithm used.
|
# table 3-8, Row 2) for more information about the algorithm used.
|
||||||
FFFD = u'\ufffd'
|
FFFD = u'\ufffd'
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,14 @@ What's New in Python 2.7 Release Candidate 1?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #8271: during the decoding of an invalid UTF-8 byte sequence, only the
|
||||||
|
start byte and the continuation byte(s) are now considered invalid, instead
|
||||||
|
of the number of bytes specified by the start byte.
|
||||||
|
E.g.: '\xf1\x80AB'.decode('utf-8', 'replace') now returns u'\ufffdAB' and
|
||||||
|
replaces with U+FFFD only the start byte ('\xf1') and the continuation byte
|
||||||
|
('\x80') even if '\xf1' is the start byte of a 4-bytes sequence.
|
||||||
|
Previous versions returned a single u'\ufffd'.
|
||||||
|
|
||||||
- Issue #8627: Remove bogus "Overriding __cmp__ blocks inheritance of
|
- Issue #8627: Remove bogus "Overriding __cmp__ blocks inheritance of
|
||||||
__hash__ in 3.x" warning. Also fix "XXX undetected error" that
|
__hash__ in 3.x" warning. Also fix "XXX undetected error" that
|
||||||
arises from the "Overriding __eq__ blocks inheritance ..." warning
|
arises from the "Overriding __eq__ blocks inheritance ..." warning
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue