Closed
Description
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)