Fix the Python 3 support of pretty_xml

This commit is contained in:
Guillaume Ayoub 2011-07-20 23:14:00 +02:00
parent 0a84905383
commit 5ea41e5f4b

View File

@ -86,8 +86,9 @@ def _pretty_xml(element, level=0):
if level and (not element.tail or not element.tail.strip()):
element.tail = i
if not level:
return '<?xml version="1.0"?>\n' + ET.tostring(
element, config.get("encoding", "request"))
output_encoding = config.get("encoding", "request")
return ('<?xml version="1.0"?>\n' + ET.tostring(
element, "utf-8").decode("utf-8")).encode(output_encoding)
def _tag(short_name, local):