From bbefeb0cfdc36f85eb6439140697254507b18642 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 7 Jul 2014 10:47:57 +0900 Subject: [PATCH] make sure we don't rename to existing prefs.db.broken --- aqt/profiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aqt/profiles.py b/aqt/profiles.py index 37db4e12d..a436e907d 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -231,7 +231,10 @@ 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 - os.rename(path, path+".broken") + broken = path+".broken" + if os.path.exists(broken): + os.unlink(broken) + os.rename(path, broken) QMessageBox.warning( None, "Preferences Corrupt", """\ Anki's prefs.db file was corrupt and has been recreated. If you were using multiple \