[sync] Do not break sync if compare-locale parser not found

RESOLVED FIXED

Status

defect
P1
normal
RESOLVED FIXED
Last month
Last month

People

(Reporter: mathjazz, Assigned: mathjazz)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Sync is broken for Seamonkey after we enabled a new locale (nl - Dutch). Enabling a new locale resulted in detecting all localizable files as changed. Since Pontoon only uses file extensions to detect localizable files, one of the detected files is suite/searchplugins/google.xml.

When we try to parse it, compare-locales parser throws an error, because it cannot find the correct parse for the file (it requires XML files to be called strings.xml). That breaks sync. Instead, we should fail gracefully and just skip the file.

Traceback:

at line 365, /app/pontoon/sync/vcs/models.py,
resources[path] = VCSResource(self, path, locales=locales)

at line 614, /app/pontoon/sync/vcs/models.py,
locale=Locale.objects.get(code='en-US')

at line 54, /app/pontoon/sync/formats/__init__.py,
return SUPPORTED_FORMAT_PARSERS[extension](path, source_path=source_path, locale=locale)

at line 122, /app/pontoon/sync/formats/compare_locales.py,
return CompareLocalesResource(path, source_resource)

at line 45, /app/pontoon/sync/formats/compare_locales.py,
self.parser = parser.getParser(self.path)

at line 57, /app/.heroku/python/lib/python2.7/site-packages/compare_locales/parser/__init__.py, 
raise UserWarning("Cannot find Parser") 
Status: ASSIGNED → RESOLVED
Closed: Last month
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.