You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is a f-string (single-line or multi-line) following a # fmt: off (with or without a pairing # fmt: on) and both the f-string and # fmt: off are inside a pair of brackets ((), [], {}), the code cannot be formatted.
The error reported is something like:
error: cannot format ???.py: {' ', 'r', 'f', 'o', ':', 'm', 't', '#', '\n'} is NOT a subset of {'U', 'r', 'f', 'u', 'F', 'R', 'b', 'B'}.
To Reproduce
Sample:
(
# fmt: offf""""""# fmt: on
)
Expected behavior
No error is reported and the code is formatted as if the f-string is a normal string.
Environment
Black's version: 24.10.0
OS and Python version: Windows and Linux / Python 3.13.0
Additional context
None
The text was updated successfully, but these errors were encountered:
Describe the bug
If there is a f-string (single-line or multi-line) following a
# fmt: off
(with or without a pairing# fmt: on
) and both the f-string and# fmt: off
are inside a pair of brackets (()
,[]
,{}
), the code cannot be formatted.The error reported is something like:
To Reproduce
Sample:
Expected behavior
No error is reported and the code is formatted as if the f-string is a normal string.
Environment
Additional context
None
The text was updated successfully, but these errors were encountered: