This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients shihai1991, steven.daprano
Date 2019-06-23.14:03:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1561298585.48.0.287091579652.issue37377@roundup.psfhosted.org>
In-reply-to
Content
It is a *syntax* error. You have written bad syntax, just as the error message says. Your \xXX code is too short, only 1 hex digit instead of 2. I disagree that this should be a value error: it isn't a bad value, it is bad syntax.

I don't know what the context of the BDFL pronouncement in PEP 223 was, but I think it was decided later that Guido wrong because the error in Python 2.4 and 2.5 was UnicodeDecodeError and then changed to SyntaxError in 2.6 (probably to match Python 3, I guess).

In Python 3, both unicode and bytes strings give a syntax error for this error.
History
Date User Action Args
2019-06-23 14:03:05steven.dapranosetrecipients: + steven.daprano, shihai1991
2019-06-23 14:03:05steven.dapranosetmessageid: <1561298585.48.0.287091579652.issue37377@roundup.psfhosted.org>
2019-06-23 14:03:05steven.dapranolinkissue37377 messages
2019-06-23 14:03:05steven.dapranocreate