astpath icon indicating copy to clipboard operation
astpath copied to clipboard

Print regular UTF-8 string instead of bytes-string

Open humdogm opened this issue 2 years ago • 1 comments

Printing a bytes string looks unreadable in the terminal e.g.

b'<tag1>\n    <tag2/>\n</tag1>'

What we want is more like:

<tag1>
    <tag2/>
</tag1>

Specify encoding to do this

Works for both xml and lxml https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.tostring https://lxml.de/3.6/api/lxml.etree-module.html#tostring

humdogm avatar Apr 20 '22 07:04 humdogm

FYI, this is fixed in https://github.com/spookylukey/pyastgrep

spookylukey avatar Oct 27 '22 09:10 spookylukey