[issue42209] Incorrect line reported in syntax error

2020-10-30 Thread gKuhn


New submission from gKuhn :

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 "", 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 
<https://bugs.python.org/issue42209>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42209] Incorrect line reported in syntax error

2020-10-30 Thread gKuhn


gKuhn  added the comment:

Ah, that makes sense, thank you for the info.

The line number is probably the most important piece of information here 
anyway. 

It sounds like the syntax error string is already planned and as such this is 
probably a duplicate. 

Please close if this is the case. 

Cheers

--

___
Python tracker 
<https://bugs.python.org/issue42209>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com