In Python 3, encoding='utf8' returns a bytestring instead of a string. I recommend using tostring(xml, encoding="unicode") instead. – Stevoisiak Feb 7 '18 at 19:18
So I believe you need to change line 159 in tools.py from:
return ElementTree.tostring(pretty_data, encoding='UTF-8')
to
return ElementTree.tostring(pretty_data, encoding='unicode')
When trying to print a computer group object I got the error:
"errorMessage": "__str__ returned non-string (type bytes)"
As per this comment on https://stackoverflow.com/questions/15304229/convert-python-elementtree-to-string:
So I believe you need to change line 159 in tools.py from:
return ElementTree.tostring(pretty_data, encoding='UTF-8')
toreturn ElementTree.tostring(pretty_data, encoding='unicode')
I did this locally and it fixed the error for me.