astpath
astpath copied to clipboard
Print regular UTF-8 string instead of bytes-string
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
FYI, this is fixed in https://github.com/spookylukey/pyastgrep