mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 06:52:39 +03:00
Handle XML parser errors
Found in checkupdates of com.dar.nclientv2.
This commit is contained in:
parent
c0b9dbddb6
commit
17c7c3948c
1 changed files with 10 additions and 2 deletions
|
@ -1564,7 +1564,11 @@ def retrieve_string(app_dir, string, xmlfiles=None):
|
||||||
for path in xmlfiles:
|
for path in xmlfiles:
|
||||||
if not os.path.isfile(path):
|
if not os.path.isfile(path):
|
||||||
continue
|
continue
|
||||||
|
try:
|
||||||
xml = parse_xml(path)
|
xml = parse_xml(path)
|
||||||
|
except XMLElementTree.ParseError:
|
||||||
|
logging.warning(_("Problem with xml at '{path}'").format(path=path))
|
||||||
|
continue
|
||||||
element = xml.find('string[@name="' + name + '"]')
|
element = xml.find('string[@name="' + name + '"]')
|
||||||
if element is not None:
|
if element is not None:
|
||||||
content = element_content(element)
|
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):
|
if not path.endswith('.xml') or not os.path.isfile(path):
|
||||||
continue
|
continue
|
||||||
logging.debug("fetch_real_name: Checking manifest at " + path)
|
logging.debug("fetch_real_name: Checking manifest at " + path)
|
||||||
|
try:
|
||||||
xml = parse_xml(path)
|
xml = parse_xml(path)
|
||||||
|
except XMLElementTree.ParseError:
|
||||||
|
logging.warning(_("Problem with xml at '{path}'").format(path=path))
|
||||||
|
continue
|
||||||
app = xml.find('application')
|
app = xml.find('application')
|
||||||
if app is None:
|
if app is None:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue