From 9c406e10d6efa7c045674926e3a3c3c324f97c64 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 28 May 2015 08:52:47 -0400 Subject: [PATCH] Clipboard: Allow for bytes or string --- gramps/gui/clipboard.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps/gui/clipboard.py b/gramps/gui/clipboard.py index af671b78a..561e8ad68 100644 --- a/gramps/gui/clipboard.py +++ b/gramps/gui/clipboard.py @@ -635,12 +635,18 @@ class ClipText(ClipWrapper): def __init__(self, dbstate, obj): super(ClipText, self).__init__(dbstate, obj) self._type = _("Text") - self._pickle = str(self._obj, "utf-8") + if isinstance(self._obj, bytes): + self._pickle = str(self._obj, "utf-8") + else: + self._pickle = self._obj self.refresh() def refresh(self): self._title = _("Text") - self._value = str(self._obj, "utf-8") + if isinstance(self._obj, bytes): + self._value = str(self._obj, "utf-8") + else: + self._value = self._obj class ClipMediaObj(ClipHandleWrapper):