Skip to content

Raw string formatting should not remove quote escape backslahes #6186

@konstin

Description

@konstin

Currently, print(r"\"" + "|" + r"\"''") gets formatted as print(r'"' + "|" + r"\"''"), but raw strings keep the backslash so they not equivalent:

> print(r"\"" + "|" + r"\"''")
\"|\"''
> print(r'"' + "|" + r"\"''")
"|\"''

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingformatterRelated to the formatter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions