Message357777
When I have a normal syntax error in a file, Python reports the filename in the exception output:
$ cat syntax_error.py
0x=5
$ python3.8 syntax_error.py
File "syntax_error.py", line 1
0x=5
^
SyntaxError: invalid hexadecimal literal
But if the syntax error is inside an f-string, Python reports 'File "<fstring>"' instead of the actual filename in the exception output.
$ cat syntax_error_in_fstring.py
f'This is a syntax error: {0x=5}'
$ python3.8 syntax_error_in_fstring.py
File "<fstring>", line 1
SyntaxError: invalid hexadecimal literal |
|
Date |
User |
Action |
Args |
2019-12-04 08:27:53 | Erik Cederstrand | set | recipients:
+ Erik Cederstrand |
2019-12-04 08:27:53 | Erik Cederstrand | set | messageid: <1575448073.72.0.500810200955.issue38964@roundup.psfhosted.org> |
2019-12-04 08:27:53 | Erik Cederstrand | link | issue38964 messages |
2019-12-04 08:27:53 | Erik Cederstrand | create | |
|