flynt icon indicating copy to clipboard operation
flynt copied to clipboard

ANSI escape codes removed/unescaped

Open lllama opened this issue 3 years ago • 1 comments

Before

"""Prints things in bold."""
s = "wot?"
print("\033[1m{0}\033[0m".format(s))

After:

"""Prints things in bold."""
s = "wot?"
print(f"{s}")

Looks like it actually writes the escape codes back as escaped text in the files. This is what it now looks like in vim:

image

When I run the script then the output is the same, but for editing purposes, keeping the original would be ideal.

lllama avatar Jul 20 '21 14:07 lllama

Hi, thanks for the bug report!

This is likely to share root cause with #55 - might take some time before this is solved.

ikamensh avatar Jul 26 '21 15:07 ikamensh

This seems to be a bug in astor, actually.

I think I may have a fix...

akx avatar Nov 21 '22 18:11 akx