This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients eric.smith
Date 2016-09-07.17:18:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473268698.62.0.800338957351.issue28002@psf.upfronthosting.co.za>
In-reply-to
Content
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'''{"'"}'''
"'"
History
Date User Action Args
2016-09-07 17:18:18eric.smithsetrecipients: + eric.smith
2016-09-07 17:18:18eric.smithsetmessageid: <1473268698.62.0.800338957351.issue28002@psf.upfronthosting.co.za>
2016-09-07 17:18:18eric.smithlinkissue28002 messages
2016-09-07 17:18:18eric.smithcreate