asottile / pyupgrade

A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
MIT License
3.62k stars 183 forks source link

Literals containing \N escapes #975

Closed inikolaev closed 1 month ago

inikolaev commented 1 month ago

After upgrading project to Python 3.12 pyupgrade started to break:

s = f"\N{EN DASH}"

is being changed into

s = f"\N{{EN DASH}}"

which is invalid.

I tested revering back to 3.11 and rerunning pyupgrade and everything looks good.

asottile commented 1 month ago

what version are you using?

inikolaev commented 1 month ago

Sorry, haven't noticed your comment earlier. I was using 3.18.0, I'll try the fix you've just released, thank you!