[New-bugs-announce] [issue42209] Incorrect line reported in syntax error

gKuhn report at bugs.python.org
Fri Oct 30 11:29:34 EDT 2020


New submission from gKuhn <gregorykuhn at gmail.com>:

Attempting to parse the following python code results in a fairly unhelpful syntax error along with an incorrect line number being reported:

    #a dodgy f-string

    def dodgy(**kwargs):
        print(f"{**kwargs}")

The result:

  File "<fstring>", line 1
    (**kwargs)
     ^
SyntaxError: invalid syntax


$ python -VV
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)]

----------
messages: 379977
nosy: gkuhn
priority: normal
severity: normal
status: open
title: Incorrect line reported in syntax error
type: behavior
versions: Python 3.8

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


More information about the New-bugs-announce mailing list