New submission from Serhiy Storchaka:

Python parser supports only ' ', '\t', '\x0c' and '\r' as whitespaces. The 
parser of f-strings raises incorrect error messages for subexpressions 
consistent only from whitespaces, if they contain whitespaces out this set.

>>> eval("\xa0")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
     
    ^
SyntaxError: invalid character in identifier
>>> eval("f'''{\xa0}'''")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<string>", line 1
SyntaxError: f-string: empty expression not allowed

----------
components: Interpreter Core
messages: 294869
nosy: eric.smith, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Incorrect error messages for invalid whitespaces in f-string 
subexpressions
type: behavior
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30529>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to