-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
formatterRelated to the formatterRelated to the formatterparserRelated to the parserRelated to the parserpython313Related to Python 3.13Related to Python 3.13python314Related to Python 3.14Related to Python 3.14
Description
Summary
With the release of 3.13.4, python/cpython#129958 was fixed, which now makes formatting produce invalid code on 3.13.4
playground link
Input:
f"{
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111:}"Output:
f"{
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111:
}"The input is valid code on 3.13.4, the output is not
$ uv run --python 3.13.4 python -c $'f"{\n11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111:}"'
$ uv run --python 3.13.4 python -c $'f"{\n 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111:\n}"'
File "<string>", line 2
1111111111111111111111111111111111111111111111111111111111111111111111111111
1111111111111:
^
SyntaxError: f-string: newlines are not allowed in format specifiers for single
quoted f-strings
Version
No response
Metadata
Metadata
Assignees
Labels
formatterRelated to the formatterRelated to the formatterparserRelated to the parserRelated to the parserpython313Related to Python 3.13Related to Python 3.13python314Related to Python 3.14Related to Python 3.14