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
untokenize of specially crafted escaped characters does not round trip properly #125821
this small program does not roundtrip through tokenize / untokenize -- it appears to mishandle the escaped quote as a \N{NAMED ESCAPE}
bar=1print(f"{bar}\"{{SNOWMAN}} {{foo}}")
this is what it produces after a round of untokenization:
$ python3 t.py t3.py bar = 1print(f"{bar} \"{ SNOWMAN}} {{foo}}")
annoyingly, tokenize_rt suffers from a different related bug which is why I was investigating this to begin with. an aside, the handling of curly braces in 3.12+ tokenization is a huge pain!
Activity
asottile commentedon Oct 21, 2024
cc @pablogsal ecf16ee
pablogsal commentedon Oct 22, 2024
Sorry is a bit late here and I had a long day, but what I am missing here:
Same with a file:
Sorry if I am missing anything obvious. Can you provide a small reproducer I can run?
pablogsal commentedon Oct 22, 2024
Ah this was fixed in db23b8b in main and was back ported to 3.12 but not yet released:
#125021
pablogsal commentedon Oct 22, 2024
Closing as duplicate of #125008
asottile commentedon Oct 22, 2024
hah yep -- just checked my vod and I spent all the time waiting on a build only to rerun my system python 🤦