Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improve error message for unterminated strings with escapes #100445

Copy link
Copy link
Closed
@hauntsaninja

Description

@hauntsaninja
Issue body actions

Inspired by #55688 and #94768.

Currently, this code raises the following error:

>>> "asdf\"
  File "<stdin>", line 1
    "asdf\"
    ^
SyntaxError: unterminated string literal (detected at line 1)

Maybe there's room to make this error message more helpful, to make the source of the error more obvious for users unfamiliar with escapes. Could the following be better?

>>> "asdf\"
  File "<stdin>", line 1
    "asdf\"
    ^
SyntaxError: unterminated string literal (detected at line 1); perhaps you escaped the end quote?

(The raw string situation in the linked issues that inspired this is a little extra tricky, since the workaround is still not clear. But hopefully the message still makes it clearer to users what is going on)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.