From: Daniel Martí Date: Wed, 30 Sep 2015 23:34:02 +0000 (-0700) Subject: checkupdates: Ignore xml tags in string content X-Git-Tag: 0.5.0~68 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=4ea5ce88890cf76bef6f31232c30a202277ff761;p=fdroidserver.git checkupdates: Ignore xml tags in string content This allows us to fetch strings like the following: foo bar Up until now, using .text would only return "foo ", but if we use .tostring() with the text method, it converts everything into plain text for us resulting in "foo bar". --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 4c3597f2..a79a4fe4 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -911,7 +911,7 @@ def retrieve_string(app_dir, string, xmlfiles=None): def element_content(element): if element.text is None: return "" - return element.text.encode('utf-8') + return XMLElementTree.tostring(element, encoding='utf-8', method='text') for path in xmlfiles: if not os.path.isfile(path):