1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

Handle XML parser errors

Found in checkupdates of com.dar.nclientv2.
This commit is contained in:
Jochen Sprickerhof 2022-03-11 09:03:03 +01:00
parent c0b9dbddb6
commit 17c7c3948c

View File

@ -1564,7 +1564,11 @@ def retrieve_string(app_dir, string, xmlfiles=None):
for path in xmlfiles:
if not os.path.isfile(path):
continue
xml = parse_xml(path)
try:
xml = parse_xml(path)
except XMLElementTree.ParseError:
logging.warning(_("Problem with xml at '{path}'").format(path=path))
continue
element = xml.find('string[@name="' + name + '"]')
if element is not None:
content = element_content(element)
@ -1606,7 +1610,11 @@ def fetch_real_name(app_dir, flavours):
if not path.endswith('.xml') or not os.path.isfile(path):
continue
logging.debug("fetch_real_name: Checking manifest at " + path)
xml = parse_xml(path)
try:
xml = parse_xml(path)
except XMLElementTree.ParseError:
logging.warning(_("Problem with xml at '{path}'").format(path=path))
continue
app = xml.find('application')
if app is None:
continue