From 1824ca1b5dc5574752c9c27aa4a571e053e9cfc6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 14 Jan 2020 14:59:46 +1000 Subject: [PATCH] fix startup when prefs.db not readable If we fail to open the Anki 2.0 prefs.db file, on the second try we need to revert to a new file instead of trying the same broken file again. --- qt/aqt/profiles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt/aqt/profiles.py b/qt/aqt/profiles.py index da404e657..381d8fae2 100644 --- a/qt/aqt/profiles.py +++ b/qt/aqt/profiles.py @@ -318,7 +318,7 @@ and no other programs are accessing your profile folders, then try again.""" opath = os.path.join(self.base, "prefs.db") path = os.path.join(self.base, "prefs21.db") - if os.path.exists(opath) and not os.path.exists(path): + if not retrying and os.path.exists(opath) and not os.path.exists(path): shutil.copy(opath, path) result.firstTime = not os.path.exists(path)