From c01ba49168f58d054b549c1d9f205f7c7147556c Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 22 Mar 2018 14:10:23 +1000 Subject: [PATCH] remove stale journal file when resetting prefs --- aqt/profiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aqt/profiles.py b/aqt/profiles.py index 4e622d2fa..4e8e8deef 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -300,7 +300,10 @@ and no other programs are accessing your profile folders, then try again.""")) self.db.close() except: pass - os.unlink(path) + for suffix in ("", "-journal"): + fpath = path + suffix + if os.path.exists(fpath): + os.unlink(fpath) QMessageBox.warning( None, "Preferences Corrupt", """\ Anki's prefs21.db file was corrupt and has been recreated. If you were using multiple \