diff --git a/gramps/cli/clidbman.py b/gramps/cli/clidbman.py index 0ff547492..d07723448 100644 --- a/gramps/cli/clidbman.py +++ b/gramps/cli/clidbman.py @@ -497,6 +497,8 @@ def time_val(dirpath): if tval_mod > tval: tval = tval_mod last = time.strftime('%x %X', time.localtime(tval)) + if sys.version_info[0] < 3: + last = last.decode(glocale.encoding) else: tval = 0 last = _("Never") diff --git a/gramps/gen/utils/unknown.py b/gramps/gen/utils/unknown.py index 794874f43..012ecb89b 100644 --- a/gramps/gen/utils/unknown.py +++ b/gramps/gen/utils/unknown.py @@ -29,6 +29,7 @@ Make an 'Unknown' primary object # Python modules # #------------------------------------------------------------------------- +import sys import time import os @@ -165,9 +166,11 @@ def create_explanation_note(dbase): those objects of type "Unknown" need a explanatory note. This funcion provides such a note for import methods. """ + tval = time.strftime('%x %X', time.localtime()) + if sys.version_info[0] < 3: + tval = tval.decode(glocale.encoding) note = Note( _('Objects referenced by this note ' - 'were missing in a file imported on %s.') % - time.strftime('%x %X', time.localtime())) + 'were missing in a file imported on %s.') % tval) note.set_handle(create_id()) note.set_gramps_id(dbase.find_next_note_gramps_id()) # Use defaults for privacy, format and type. diff --git a/gramps/plugins/lib/libgedcom.py b/gramps/plugins/lib/libgedcom.py index f09914baa..fe331ffff 100644 --- a/gramps/plugins/lib/libgedcom.py +++ b/gramps/plugins/lib/libgedcom.py @@ -2822,7 +2822,12 @@ class GedcomParser(UpdateCallback): else: message = _("GEDCOM import report: %s errors detected") % \ self.number_of_errors - self.user.info(message, "".join(self.errors), monospaced=True) + if hasattr(self.user.uistate, 'window'): + parent_window = self.user.uistate.window + else: + parent_window = None + self.user.info(message, "".join(self.errors), + parent = parent_window, monospaced=True) def __clean_up(self): """