From 1a0784b154e557d509fc927ecfe0407a8205c356 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Thu, 12 Mar 2015 18:13:38 +0000 Subject: [PATCH] Fix another handle type bug --- gramps/gui/filters/sidebar/_sidebarfilter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gramps/gui/filters/sidebar/_sidebarfilter.py b/gramps/gui/filters/sidebar/_sidebarfilter.py index 2e91b91ac..7b71debce 100644 --- a/gramps/gui/filters/sidebar/_sidebarfilter.py +++ b/gramps/gui/filters/sidebar/_sidebarfilter.py @@ -29,6 +29,7 @@ from gi.repository import Pango from ... import widgets from ...dbguielement import DbGUIElement from gramps.gen.config import config +from gramps.gen.constfunc import UNITYPE _RETURN = Gdk.keyval_from_name("Return") _KP_ENTER = Gdk.keyval_from_name("KP_Enter") @@ -212,6 +213,9 @@ class SidebarFilter(DbGUIElement): self.__tag_list = [] for handle in self.dbstate.db.get_tag_handles(sort_handles=True): tag = self.dbstate.db.get_tag_from_handle(handle) + # for python3 this returns a byte object, so conversion needed + if not isinstance(handle, UNITYPE): + handle = handle.decode('utf-8') self.__tag_list.append((tag.get_name(), handle)) self.on_tags_changed([item[0] for item in self.__tag_list])