From 238ff455f72e15b5818c94a3232e17e5d7863bc0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 6 Nov 2020 18:16:48 +0530 Subject: [PATCH] Edit book: Fix regression in calibre 5 that caused an error when managing user dictionaries. Fixes #1903294 [Preferences / Editor settings / Manage spelling dictionaries throws exception](https://bugs.launchpad.net/calibre/+bug/1903294) --- src/calibre/gui2/tweak_book/spell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/spell.py b/src/calibre/gui2/tweak_book/spell.py index c491bcb985..436d3ae81c 100644 --- a/src/calibre/gui2/tweak_book/spell.py +++ b/src/calibre/gui2/tweak_book/spell.py @@ -502,7 +502,7 @@ class ManageDictionaries(Dialog): # {{{ if countrycode == best_country: j.setData(0, Qt.FontRole, bf) pd = get_dictionary(DictionaryLocale(lc, countrycode)) - for dictionary in sorted(languages[lc][countrycode], key=lambda d:d.name): + for dictionary in sorted(languages[lc][countrycode], key=lambda d:(d.name or '')): k = QTreeWidgetItem(j, DICTIONARY) pl = calibre_langcode_to_name(dictionary.primary_locale.langcode) if dictionary.primary_locale.countrycode: