[New-bugs-announce] [issue40449] multi-line f-string, syntaxerror points to wrong line

Gerrit Holl report at bugs.python.org
Thu Apr 30 06:43:54 EDT 2020


New submission from Gerrit Holl <gerrit.holl at gmail.com>:

When there is a syntax error in a multi-line f-string, the arrow in the reported syntax error points to the wrong line:

$ cat mwe.py 
s = ("apricot "
     "pineapple"
     f"shallot{")
$ python mwe.py 
  File "mwe.py", line 1
    s = ("apricot "
        ^
SyntaxError: f-string: expecting '}'

Tested with Python 3.7.4 and 3.8.2.

----------
components: Interpreter Core
messages: 367753
nosy: Gerrit.Holl
priority: normal
severity: normal
status: open
title: multi-line f-string, syntaxerror points to wrong line
versions: Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list