[issue34935] Misleading error message in str.decode()

2018-10-10 Thread Ezio Melotti
Change by Ezio Melotti : -- assignee: -> ezio.melotti resolution: -> not a bug stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker ___ __

[issue34935] Misleading error message in str.decode()

2018-10-08 Thread Walter Dörwald
Walter Dörwald added the comment: OK, I see, http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf (Table 3-7 on page 93) states that the only valid 3-bytes UTF-8 sequences starting with the byte 0xED have a value for the second byte in the range 0x80 to 0x9F. 0xA0 is just beyond that range (

[issue34935] Misleading error message in str.decode()

2018-10-08 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This behavior is intentional, for conformance with the Unicode Standard recommendations. See issue8271. -- nosy: +serhiy.storchaka ___ Python tracker _

[issue34935] Misleading error message in str.decode()

2018-10-08 Thread Walter Dörwald
New submission from Walter Dörwald : The following code issues a misleading exception message: >>> b'\xed\xa0\xbd\xed\xb3\x9e'.decode("utf-8") Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation b