From eca0c0dbbd7b618584344de269acafe71ac31a40 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 27 Jan 2021 17:31:14 -0600 Subject: [PATCH] Fixed shelve method --- src/sessions/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sessions/base.py b/src/sessions/base.py index 8d58e5bf..235245e8 100644 --- a/src/sessions/base.py +++ b/src/sessions/base.py @@ -75,7 +75,7 @@ class baseSession(object): def shelve(self): """Shelve the database to allow for persistance.""" - shelfname=os.path.join(paths.config_path(), str(self.session_id)+"/cache") + shelfname=os.path.join(paths.config_path(), str(self.session_id), "cache") if self.settings["general"]["persist_size"] == 0: if os.path.exists(shelfname+".dat"): os.remove(shelfname+".dat") @@ -84,7 +84,7 @@ class baseSession(object): if not os.path.exists(shelfname+".dat"): output.speak("Generating database, this might take a while.",True) shelf=shelve.open(os.path.join(paths.config_path(), shelfname),'c') - for key,value in list(self.db.items()): + for key, value in list(self.db.items()): if type(key) != str and type(key) != str: output.speak("Uh oh, while shelving the database, a key of type " + str(type(key)) + " has been found. It will be converted to type str, but this will cause all sorts of problems on deshelve. Please bring this to the attention of the " + application.name + " developers immediately. More information about the error will be written to the error log.",True) log.error("Uh oh, " + str(key) + " is of type " + str(type(key)) + "!")