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 <rep...@bugs.python.org>
<http://bugs.python.org/issue31140>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to