From 0163a8528c7fc328b67770f4aeded49a6f418897 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gramps/gui/views/treemodels/flatbasemodel.py b/gramps/gui/views/treemodels/flatbasemodel.py index 625c08797..2ea4401e0 100644 --- a/gramps/gui/views/treemodels/flatbasemodel.py +++ b/gramps/gui/views/treemodels/flatbasemodel.py @@ -577,7 +577,11 @@ 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 - srt_keys=[(self.sort_func(data), key) for key, data in cursor] + if sys.version_info[0] >= 3: + srt_keys=[(self.sort_func(data), key.decode('utf8')) + for key, data in cursor] + else: + srt_keys=[(self.sort_func(data), key) for key, data in cursor] srt_keys.sort() return srt_keys