From 4f7579c660e05eb4dd9ecd19e31803102e769c3c Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 31 Jul 2007 04:23:30 +0000 Subject: [PATCH] * src/DbLoader.py (DbLoader.do_import): catch unicode encoding errors 2007-07-30 Don Allingham svn: r8793 --- ChangeLog | 3 +++ src/DbLoader.py | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7ce567b04..2cb5583f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-07-30 Don Allingham + * src/DbLoader.py (DbLoader.do_import): catch unicode encoding errors + 2007-07-30 Don Allingham * src/GrampsDbUtils/_GedcomParse.py: assign inline note to the referencing object * src/GrampsDbUtils/_GedcomLex.py: fix UNKNOWN gender diff --git a/src/DbLoader.py b/src/DbLoader.py index 17a92c310..f6c3d5bd4 100644 --- a/src/DbLoader.py +++ b/src/DbLoader.py @@ -492,6 +492,12 @@ class DbLoader: importer(self.dbstate.db, filename, self.uistate.pulse_progressbar) dirname = os.path.dirname(filename) + os.path.sep Config.set(Config.RECENT_IMPORT_DIR, dirname) + except UnicodeError, msg: + QuestionDialog.ErrorDialog( + _("Could not import file: %s") % filename, + _("This GEDCOM file incorrectly identifies its character " + "set, so it cannot be accurately imported. Please fix the " + "encoding, and import again") + "\n\n %s" % msg) except Exception: _LOG.error("Failed to import database.", exc_info=True)