[elbe-devel] [PATCH 1/3] elbepack: treeutils: fix tosting() method
Thomas Weißschuh
thomas.weissschuh at linutronix.de
Thu May 16 12:14:28 CEST 2024
The use lxml functions do not exist, use the corret ones.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
elbepack/treeutils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/elbepack/treeutils.py b/elbepack/treeutils.py
index 7528d4a8112f..9df3e85d56e1 100644
--- a/elbepack/treeutils.py
+++ b/elbepack/treeutils.py
@@ -5,7 +5,7 @@
import copy
from lxml.etree import Element, ElementTree, SubElement
-from lxml.etree import XMLParser, parse
+from lxml.etree import XMLParser, parse, tostring
# ElementTree helpers
@@ -121,7 +121,7 @@ class etree(ebase):
self.et.write(fname, encoding=encoding)
def tostring(self):
- return self.et.tostring()
+ return tostring(self.et, encoding='utf-8').decode('utf-8')
def ensure_child(self, tag):
retval = self.et.find('./' + tag)
--
2.45.0
More information about the elbe-devel
mailing list