On Wed, Nov 13, 2019 at 12:29 AM Chris Angelico <ros...@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 -- https://mail.python.org/mailman/listinfo/python-list