From: Daniel Martí Date: Sun, 25 Oct 2015 23:28:29 +0000 (+0100) Subject: Add an extra strip() to work around tostring issue X-Git-Tag: 0.5.0~22 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9017328698e699bea75e96dc30b07f7146158a24;p=fdroidserver.git Add an extra strip() to work around tostring issue In cases like this xml code: "OpenKeychain" "Encrypt" tostring() returns trailing whitespaces (including newlines). Which aren't removed until the very end, after we try to remove enclosing quotes. So strip right after tostring() too, since we never really care about whitespaces anyway. --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 47db0101..db2e0f09 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -914,7 +914,8 @@ def retrieve_string(app_dir, string, xmlfiles=None): def element_content(element): if element.text is None: return "" - return XMLElementTree.tostring(element, encoding='utf-8', method='text') + s = XMLElementTree.tostring(element, encoding='utf-8', method='text') + return s.strip() for path in xmlfiles: if not os.path.isfile(path):