-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
can not unparse code with ' in format_spec #112364
Copy link
Copy link
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Bug report
Bug description:
The following example shows that it is not possible to unparse a f-string with a ' in the format_spec, but such code can be generated when the f-string is double-quoted.
expected behaviour:
unparseshould use different quotes if quotes are part of the format_spec.This is only a problem in 3.12 and worked in 3.11
output (Python 3.12.0):
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs