You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>>codecs.decode('\u{0041}',encoding='unicode-escape')
File"<python-input-2>", line1codecs.decode('\u{0041}',encoding='unicode-escape')
^^^^^^^^^^SyntaxError: (unicodeerror) 'unicodeescape'codeccan't decode bytes in position 0-1: truncated \uXXXXescape>>>codecs.decode('\u0041',encoding='unicode-escape')
'A'>>>'\u{0041}'File"<python-input-4>", line1'\u{0041}'^^^^^^^^^^SyntaxError: (unicodeerror) 'unicodeescape'codeccan't decode bytes in position 0-1: truncated \uXXXXescape>>>'\u0041''A'
I'm not sure when the \u{xxx} escape was introduced to the world, but it should be recognized by codecs.decode and the Python interpreter. The above sample was run on Python 3.13.1 on Windows.
CPython versions tested on:
3.13
Operating systems tested on:
No response
The text was updated successfully, but these errors were encountered:
@mrolle45 : What's your evidence that this escape sequence was "introduced to the world"? And even if it were, we'd need more motivation than that to add it to Python. What problem would it solve?
Bug report
Bug description:
I'm not sure when the \u{xxx} escape was introduced to the world, but it should be recognized by
codecs.decode
and the Python interpreter. The above sample was run on Python 3.13.1 on Windows.CPython versions tested on:
3.13
Operating systems tested on:
No response
The text was updated successfully, but these errors were encountered: