-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed as not planned
Closed as not planned
Copy link
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
According to the docs,
Both string and bytes literals may optionally be prefixed with a letter 'r' or 'R'; such strings are called raw strings and treat backslashes as literal characters1
This does not hold during the lexing stage, where backslashes in raw strings always escape quotation marks:
print(r'\') # Causes SyntaxError, should print a single backslash
print(r'\'') # Prints `\'`, should give a syntax errorCPython versions tested on:
3.12
Operating systems tested on:
Linux
Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error