[issue38964] Output of syntax error in f-string contains wrong filename

Eric V. Smith report at bugs.python.org
Wed Dec 4 08:23:16 EST 2019


Eric V. Smith <eric at trueblade.com> added the comment:

I agree that although the PEP says that's how it behaves, that shouldn't be prescriptive of the error message. Clearly we can be more helpful here.

I have a large, elaborate re-write of the error generating code that I've been working on, on and off for over a year, which would address this problem. I'm not sure when or if I'll finish it. It touches a lot of things, and my branch won't merge cleanly any more.

Additionally, the idea of moving f-strings into the Python grammar would also fix this problem. That might be a better way forward, although it has a number of downsides, too.

----------

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


More information about the Python-bugs-list mailing list