From 1099b743b79dea05b0c2d91abd90959e426d56d1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 7 Jul 2014 13:18:00 +0900 Subject: [PATCH] yet another file locking bug: must close prefs.db before moving --- aqt/profiles.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aqt/profiles.py b/aqt/profiles.py index a436e907d..f0444fe5e 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -231,6 +231,11 @@ and no other programs are accessing your profile folders, then try again.""")) new = not os.path.exists(path) def recover(): # if we can't load profile, start with a new one + if self.db: + try: + self.db.close() + except: + pass broken = path+".broken" if os.path.exists(broken): os.unlink(broken)