From e7a279e1c4808129af4699dc6ee1dadccb60ce6e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 19 Apr 2014 18:52:28 +0530 Subject: [PATCH] Ignore added dictionaries that do not have a country code These dictionaries were added mistakenly due to a bug in 1.33 --- src/calibre/spell/dictionary.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/spell/dictionary.py b/src/calibre/spell/dictionary.py index 82dfe03393..fbd006b7ab 100644 --- a/src/calibre/spell/dictionary.py +++ b/src/calibre/spell/dictionary.py @@ -91,8 +91,11 @@ def custom_dictionaries(reread=False): except IndexError: continue base = os.path.dirname(lc) + ploc = parse_lang_code(locale) + if ploc.countrycode is None: + continue dics.append(Dictionary( - parse_lang_code(locale), frozenset(map(parse_lang_code, locales)), os.path.join(base, '%s.dic' % locale), + ploc, frozenset(filter(lambda x:x.countrycode is not None, map(parse_lang_code, locales))), os.path.join(base, '%s.dic' % locale), os.path.join(base, '%s.aff' % locale), False, name, os.path.basename(base))) _custom = frozenset(dics) return _custom