From 55a20ab1e352740c9cc883d25d7b39d884d782e8 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 8 Feb 2015 19:50:03 +0000 Subject: [PATCH] 7930: Fix removing rows in flat list views --- gramps/gui/views/treemodels/flatbasemodel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gramps/gui/views/treemodels/flatbasemodel.py b/gramps/gui/views/treemodels/flatbasemodel.py index e0aa29beb..5c560faea 100644 --- a/gramps/gui/views/treemodels/flatbasemodel.py +++ b/gramps/gui/views/treemodels/flatbasemodel.py @@ -592,7 +592,12 @@ class FlatBaseModel(GObject.GObject, Gtk.TreeModel): # use cursor as a context manager with self.gen_cursor() as cursor: #loop over database and store the sort field, and the handle - return sorted((self.sort_func(data), key) for key, data in cursor) + if sys.version_info[0] >= 3: + return sorted((self.sort_func(data), key.decode('utf8')) + for key, data in cursor) + else: + return sorted((self.sort_func(data), key) + for key, data in cursor) def _rebuild_search(self, ignore=None): """ function called when view must be build, given a search text