asottile / pyupgrade

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

Weird behaviour of multi-line using triple quotes notation f-string containing emoji #957

Closed mboutet closed 1 month ago

mboutet commented 1 month ago

pyupgrade 3.17.0 transforms:

f"""
😃{foo}
"""

into:

f"""
😃{fo{foo}
"""

which is invalid Python syntax.

The above example has been simplified to the minimal working example I could come up with.

Python version is 3.12.4 if that matters.

Thank you!

asottile commented 1 month ago

please search for duplicates there are at least two