From e7cf5e5025f7a97540a3fa07cee736e928f67665 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 26 Jul 2018 18:46:33 +0200 Subject: [PATCH] fix xmllint_format by encoding as utf-8 and keeping fingers crossed that it will work in 27 34 and 36 --- ocrd/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ocrd/utils.py b/ocrd/utils.py index 59cf5a30b..5754afdeb 100644 --- a/ocrd/utils.py +++ b/ocrd/utils.py @@ -75,10 +75,10 @@ def xmllint_format(xml): from lxml import etree as ET parser = ET.XMLParser(resolve_entities=False, strip_cdata=False, remove_blank_text=True) document = ET.fromstring(xml, parser) - return '%s\n%s' % ( + return ('%s\n%s' % ( '', ET.tostring(document, pretty_print=True) - ) + )).encode('utf-8') def is_string(val): # pylint: disable=undefined-variable