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
{{ message }}
Repository navigation
Tokenizer/untokenizer seems to break when linting multiline strings with variables/emojis #120377
Linting this file with the latest versions of pyupgrade and docformatter on Python 3.12.4:
def test(test_arg1):
content = f"""
<table style="width: 100%; height: 100%; font-size: 1.1em;">
<tr>
<td style="width: 100%; height: 100%;">🔗 This is a test {test_arg1} </td>
</tr>
</table>
"""
return content
seems to break:
def test(test_arg1):
content = f"""
<table style="width: 100%; height: 100%; font-size: 1.1em;">
<tr>
<td style="width: 100%; height: 100%;">🔗 This is a test {te{test_arg1} </td>
</tr>
</table>
"""
return content
I filed PyCQA/docformatter#282 and asottile/pyupgrade#949; the maintainer of pyupgrade directed me here. I wasn't able to find a duplicate f-string or tokenizer issue, so hoping this is of help - thanks!
Activity
pygeek commentedon Jun 12, 2024
Try upgrading to 3.12.3 or later. It's possible that this bug was fixed.
See: #115171 .
asottile commentedon Jun 12, 2024
this is a regression in 3.12.4 -- here's the difference in tokenization output --
biisected to 4a0af0c
cc @lysnikolaou @pablogsal
lysnikolaou commentedon Jun 12, 2024
Thanks for the report!
Duplicate of #120343.