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
{{ message }}
Repository navigation
No SyntaxWarning for an invalid escape sequence when the backslash is followed by a non-ASCII character #162599
"Unrecognized escape sequences produce a SyntaxWarning" (escape sequences), and '\q' warns, but '\é' (as in 'C:\Élodie') is accepted silently, in f-strings too:
"'\\q'" SyntaxError: "\q" is an invalid escape sequence. Did you mean "\\q"? A raw string is also an option.
"'\\\xe9'" no warning
"f'\\\xe9'" no warning
decode_unicode_with_escapes (Parser/string_parser.c) rewrites the backslash as \u005c when the next character is non-ASCII, so the escape decoder never sees the invalid escape. I found it while writing a Lean spec of Python.
Thank you for taking the time to open this issue. Python is a community-driven project, and we want it to be a welcoming place to learn and collaborate.
This issue appears to have been written with AI assistance. Please explain your issue in your own words and describe how you checked the information you provided. This helps us understand your issue and leaves more time to address other issues.
Activity
bedevere-app commentedon Nov 25, 2026
Thank you for taking the time to open this issue. Python is a community-driven project, and we want it to be a welcoming place to learn and collaborate.
This issue appears to have been written with AI assistance. Please explain your issue in your own words and describe how you checked the information you provided. This helps us understand your issue and leaves more time to address other issues.
Please read our guidelines for using AI tools.