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 lys.nikolaou
Recipients eric.smith, gvanrossum, lys.nikolaou, pablogsal
Date 2020-06-22.23:53:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592870022.32.0.609883413471.issue41084@roundup.psfhosted.org>
In-reply-to
Content
It's relatively easy to identify if a SyntaxError occurs when parsing an fstring expression or not. The idea is to slightly change the error message to start with "f-string: " when it does (in the same way in which SyntaxError messages are produced by the hand-written fstring parser). I have a working PR that produces the following:

$ cat a.py
f'{a $ b}'
$ ./python.exe a.py
  File "/Users/lysnikolaou/Repositories/cpython/a.py", line 1
    (a $ b)
       ^
SyntaxError: f-string: invalid syntax

Thoughts?
History
Date User Action Args
2020-06-22 23:53:42lys.nikolaousetrecipients: + lys.nikolaou, gvanrossum, eric.smith, pablogsal
2020-06-22 23:53:42lys.nikolaousetmessageid: <1592870022.32.0.609883413471.issue41084@roundup.psfhosted.org>
2020-06-22 23:53:42lys.nikolaoulinkissue41084 messages
2020-06-22 23:53:42lys.nikolaoucreate