From f4c94c48b43d746abbe2d8852d218312a17aeaf9 Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 10 Nov 2018 11:13:42 -0600 Subject: [PATCH] Fix config file load for bad/old style Python syntax --- gramps/gen/utils/configmanager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gramps/gen/utils/configmanager.py b/gramps/gen/utils/configmanager.py index d46cc64ee..79d3c8086 100644 --- a/gramps/gen/utils/configmanager.py +++ b/gramps/gen/utils/configmanager.py @@ -299,7 +299,12 @@ class ConfigManager: continue # with next setting ####################### End upgrade code else: - value = safe_eval(raw_value) + try: + value = safe_eval(raw_value) + except: + # most likely exception is SyntaxError but + # others are possible ex: '0L' from Python2 days + value = None ####################### Now, let's test and set: if (name in self.default and setting in self.default[name]):