From 034033710706d13cf397a4af1f9aa04da25e5f5b Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Wed, 28 Nov 2018 17:37:49 -0600 Subject: [PATCH] Fix startup messages with bad filename (#720) Fixes #10885 --- gramps/cli/arghandler.py | 2 +- gramps/gui/grampsgui.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps/cli/arghandler.py b/gramps/cli/arghandler.py index 83788a6e0..d6a9d8428 100644 --- a/gramps/cli/arghandler.py +++ b/gramps/cli/arghandler.py @@ -382,7 +382,7 @@ class ArgHandler: self.open = db_path self.__open_action() else: - sys.exit(1) + sys.exit(_("Error: cannot open '%s'") % self.open_gui) return db_path # if not open_gui, parse any command line args. We can only have one diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py index 16b74c02e..6bd984e5a 100644 --- a/gramps/gui/grampsgui.py +++ b/gramps/gui/grampsgui.py @@ -369,8 +369,11 @@ def __startgramps(errors, argparser): quit_now = True if err.code: exit_code = err.code - LOG.error("Gramps terminated with exit code: %d.", err.code, - exc_info=True) + if isinstance(err.code, str): + LOG.error(err.code, exc_info=False) + else: + LOG.error("Gramps terminated with exit code: %d.", err.code, + exc_info=False) except OSError as err: quit_now = True exit_code = err.errno or 1