Funny behavior of IDLE 3.7.0

Chris Angelico rosuav at gmail.com
Tue Nov 12 08:50:16 EST 2019


On Wed, Nov 13, 2019 at 12:29 AM Chris Angelico <rosuav at gmail.com> wrote:
> If it can find the position of the specific braced expression within
> the string, great! But at very least, it should report the location of
> the string in its original file.

Further to this: If a runtime (non-syntax) error occurs, it is
correctly reported. This is handled by fstring_fix_node_location in
ast.c, which adjusts the reported locations so future error handling
gets things right. But that happens *after* any syntax errors get
reported, which happens in pythonrun.c inside err_input(), I think.
That doesn't get adjusted to the main file's locations, so it gets
reported as "<fstring>" line 1.

ChrisA


More information about the Python-list mailing list