[issue44369] Improve syntax error for wrongly closed strings

Pablo Galindo Salgado report at bugs.python.org
Mon Jun 14 14:54:32 EDT 2021


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

One problem with that is that the lookahead will move the error indicator to some incorrect place if the match fails. For example:

PYTHON3.9

>>> "dfssdfsdfsd" fdsf sdfsdfsd {}
  File "<stdin>", line 1
    "dfssdfsdfsd" fdsf sdfsdfsd {}
                  ^
SyntaxError: invalid syntax

with this PR:

>>> "dfssdfsdfsd" fdsf sdfsdfsd {}
  File "<stdin>", line 1
    "dfssdfsdfsd" fdsf sdfsdfsd {}
                                ^
SyntaxError: invalid syntax

We need a solution to this problem first

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44369>
_______________________________________


More information about the Python-bugs-list mailing list