[issue31140] Insufficient error message with incorrect formated string literal
chris.259263
report at bugs.python.org
Tue Aug 8 04:55:58 EDT 2017
New submission from chris.259263:
Trying to run a script with a bug in a formated string literal (in the example the ":" is missing) throws an "invalid syntax" error at the first expression of the script.
Example:
import math
a = "a"
b = f"{a>2s}" # forgotten ":", should be f"{a:>2s}"
Running this script throws an "invalid syntax" error in the first line "import math".
In a large program this behavior makes it nearly impossible to find the real bug in the program as the error message does not give any hint about the line or the type of the error in the program.
Using Python 3.6.2, IDLE 3.6.2 on Mac macOS Sierra (10.12.1)
----------
messages: 299901
nosy: chris.259263
priority: normal
severity: normal
status: open
title: Insufficient error message with incorrect formated string literal
type: behavior
versions: Python 3.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue31140>
_______________________________________
More information about the Python-bugs-list
mailing list