From 542450bf6df4db8e6239f6a9329014d8c87e0890 Mon Sep 17 00:00:00 2001 From: kulath Date: Sun, 1 Mar 2015 16:51:25 +0000 Subject: [PATCH] 0007824: Regression: running gramps from crontab fails --- gramps/gen/db/write.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gramps/gen/db/write.py b/gramps/gen/db/write.py index 742898352..5e51c3421 100644 --- a/gramps/gen/db/write.py +++ b/gramps/gen/db/write.py @@ -2529,7 +2529,9 @@ def write_lock_file(name): try: user = os.getlogin() except: - user = os.environ['USER'] #not win, don't need get_env_var + # not win, so don't need get_env_var. + # under cron getlogin() throws and there is no USER. + user = os.environ.get('USER', 'noUSER') if host: text = "%s@%s" % (user, host) else: