From cd23d46b5a5a51a1f5b25e339acbc865ba2cb618 Mon Sep 17 00:00:00 2001 From: Dave Schaefer Date: Sun, 13 Dec 2015 13:58:15 -0700 Subject: [PATCH] checkloc - explicitly specify namespace(s) when searching Fix for behaviour change in lxml 3.5.0 --- checkloc.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/checkloc.py b/checkloc.py index 024f1ac..9ff912d 100644 --- a/checkloc.py +++ b/checkloc.py @@ -46,7 +46,7 @@ # MAJOR version when you make backwards-incompatible changes, # MINOR version when you add functionality in a backwards-compatible manner # PATCH version when you make backwards-compatible bug fixes. -VERSION = "2.1" +VERSION = "2.1.1" # the en-US translation will have all files and strings created. Use it as the base. BASE_LOC = 'en-US' @@ -477,7 +477,12 @@ def validate_manifests(self): try: xml = etree.parse(install_rdf) root = xml.getroot() - for locale in root.findall('.//em:locale', root.nsmap): + # lxml 3.5.0 raises a ValueError if the namespace map + # contains a 'None' entry, even if it also contains + # other valid mappings. + # Therefore explicitly add only the namespaces we need + ns = {'em': 'http://www.mozilla.org/2004/em-rdf#'} + for locale in root.findall('.//em:locale', ns): loc = locale.text if loc not in self.rdf_locs: self.rdf_locs[loc] = True