diff --git a/gramps/gen/plug/_pluginreg.py b/gramps/gen/plug/_pluginreg.py index f3b46a226..04167cafc 100644 --- a/gramps/gen/plug/_pluginreg.py +++ b/gramps/gen/plug/_pluginreg.py @@ -1096,7 +1096,13 @@ class PluginRegister(object): continue lenpd = len(self.__plugindata) full_filename = os.path.join(dir, filename) - fd = io.open(full_filename, "r", encoding='utf-8') + try: + fd = io.open(full_filename, "r", encoding='utf-8') + except Exception as msg: + print(_('ERROR: Failed reading plugin registration %(filename)s') % \ + {'filename' : filename}) + print(msg) + continue stream = fd.read() fd.close() if os.path.exists(os.path.join(os.path.dirname(full_filename), diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index b9f5c84f8..c60da70be 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -383,7 +383,7 @@ def __startgramps(errors, argparser): % e.code, exc_info=True) except OSError as e: quit_now = True - exit_code = e[0] or 1 + exit_code = e.errno or 1 try: fn = e.filename except AttributeError: