This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients terry.reedy
Date 2021-03-23.02:03:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1616465031.1.0.790398051902.issue43600@roundup.psfhosted.org>
In-reply-to
Content
Spinoff from #41064.  In current python, the f'{*x}' traceback ends with 

    (*x)
     ^
SyntaxError: f-string: can't use starred expression here.

For f'{**x}', the message is "f-string: invalid syntax" and the ^ is also under the 2nd character in the replacement expression actually parsed (with a restricted grammar).

The Python error handler must special case a syntax error message beginning with 'f-string:' and search the input line for {...} and add its offset.

IDLE currently highlights "'", the 2nd char of the original code, instead of '*', the 2nd char of the e.text replacement.  It needs to also adjust the offset.
History
Date User Action Args
2021-03-23 02:03:51terry.reedysetrecipients: + terry.reedy
2021-03-23 02:03:51terry.reedysetmessageid: <1616465031.1.0.790398051902.issue43600@roundup.psfhosted.org>
2021-03-23 02:03:50terry.reedylinkissue43600 messages
2021-03-23 02:03:50terry.reedycreate