[New-bugs-announce] [issue28002] f-strings do not round trip through Tools/parser/test_unparse.py

Eric V. Smith report at bugs.python.org
Wed Sep 7 13:18:18 EDT 2016


New submission from Eric V. Smith:

The problem relates to how f-strings are re-created.

For the input file foo.txt containing this one line:
f'''{"'"}'''

Run:
./python Tools/parser/test_unparse.py foo.txt

Gives this output:
f'{"\'"}'

This result is not a valid f-string, since it contains a backslash inside the expression part of the f-string.

The input string is a valid f-string:
>>> f'''{"'"}'''
"'"

----------
components: Demos and Tools
messages: 274841
nosy: eric.smith
priority: low
severity: normal
status: open
title: f-strings do not round trip through Tools/parser/test_unparse.py
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28002>
_______________________________________


More information about the New-bugs-announce mailing list