Summary
The fix for f-string (UP032) will fail if the braces ({ and }) are created via escapes instead of literal characters: Example
PS ~>echo '"\x7btest\x7d".format(test=1)' | uvx ruff check --select UP032 --fix -
"\x7btest\x7d"
Found 1 error (1 fixed, 0 remaining).
This does work properly with .format and could be fixed the same way as the non-cursed version:
>>> "\x7btest\x7d".format(test=1)
'1'
>>> f"{1}"
'1'
This also applies to all the other ways of writing { and } non-literally (\x, \u, \U, \N)
Version
ruff 0.12.7 (c5ac998 2025-07-29)
Summary
The fix for f-string (UP032) will fail if the braces (
{and}) are created via escapes instead of literal characters: ExampleThis does work properly with
.formatand could be fixed the same way as the non-cursed version:This also applies to all the other ways of writing
{and}non-literally (\x,\u,\U,\N)Version
ruff 0.12.7 (c5ac998 2025-07-29)