diff --git a/CHANGELOG b/CHANGELOG index 20de9e108..1501eae68 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Zenmap] Fixed a crash when using the en_NG locale: "ValueError: + unknown locale: en_NG" [David Fifield] + o [NSE] Added http-get by Alex Weber. This script looks for a .git repository directory accesible over HTTP and extracts useful information from it. diff --git a/zenmap/zenmapCore/I18N.py b/zenmap/zenmapCore/I18N.py index 62b982fdf..f4391fa3a 100644 --- a/zenmap/zenmapCore/I18N.py +++ b/zenmap/zenmapCore/I18N.py @@ -106,9 +106,15 @@ def get_locales(): if val: locales = val.split(":") break - loc, enc = locale.getdefaultlocale() - if loc is not None: - locales.append(loc) + try: + loc, enc = locale.getdefaultlocale() + if loc is not None: + locales.append(loc) + except ValueError: + # locale.getdefaultlocale can fail with ValueError on certain locale + # names; it has been seen with at least en_NG. + # http://bugs.python.org/issue6895 + pass return locales def install_gettext(locale_dir):