Error
This is a known issue: bpo-18378:
nxdrive/engine/tracker.py:46: in __init__ self._tracker.set("language", self.current_locale) nxdrive/engine/tracker.py:69: in current_locale encoding = locale.getdefaultlocale()[1] or "" ../deploy-dir/.pyenv/versions/3.7.3/lib/python3.7/locale.py:568: in getdefaultlocale return _parse_localename(localename) localename = 'UTF-8' def _parse_localename(localename): """ Parses the locale code for localename and returns the result as tuple (language code, encoding). The localename is normalized and passed through the locale alias engine. A ValueError is raised in case the locale name cannot be parsed. The language code corresponds to RFC 1766. code and encoding can be None in case the values cannot be determined or are unknown to this implementation. """ code = normalize(localename) if '@' in code: # Deal with locale modifiers code, modifier = code.split('@', 1) if modifier == 'euro' and '.' not in code: # Assume Latin-9 for @euro locales. This is bogus, # since some systems may use other encodings for these # locales. Also, we ignore other modifiers. return code, 'iso-8859-15' if '.' in code: return tuple(code.split('.')[:2]) elif code == 'C': return None, None > raise ValueError('unknown locale: %s' % localename) E ValueError: unknown locale: UTF-8
Action
- We should contribute a patch upstream.
- In the meantime, use try...except and use utf-8 by default.