* src/DbLoader.py (DbLoader.do_import): catch unicode encoding errors

2007-07-30  Don Allingham  <don@gramps-project.org>


svn: r8793
This commit is contained in:
Don Allingham 2007-07-31 04:23:30 +00:00
parent 47cbc6f5d8
commit 4f7579c660
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2007-07-30 Don Allingham <don@gramps-project.org>
* src/DbLoader.py (DbLoader.do_import): catch unicode encoding errors
2007-07-30 Don Allingham <don@gramps-project.org>
* src/GrampsDbUtils/_GedcomParse.py: assign inline note to the referencing object
* src/GrampsDbUtils/_GedcomLex.py: fix UNKNOWN gender

View File

@ -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)