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

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

Closed mboutet closed 3 months ago

mboutet commented 3 months 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 3 months ago

please search for duplicates there are at least two