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 <>
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
f'{a $ b}'
$ ./python.exe
  File "/Users/lysnikolaou/Repositories/cpython/", line 1
    (a $ b)
SyntaxError: f-string: invalid syntax

Date User Action Args
2020-06-22 23:53:42lys.nikolaousetrecipients: + lys.nikolaou, gvanrossum, eric.smith, pablogsal
2020-06-22 23:53:42lys.nikolaousetmessageid: <>
2020-06-22 23:53:42lys.nikolaoulinkissue41084 messages
2020-06-22 23:53:42lys.nikolaoucreate