mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
yet another file locking bug: must close prefs.db before moving
This commit is contained in:
parent
bbefeb0cfd
commit
1099b743b7
1 changed files with 5 additions and 0 deletions
|
|
@ -231,6 +231,11 @@ and no other programs are accessing your profile folders, then try again."""))
|
||||||
new = not os.path.exists(path)
|
new = not os.path.exists(path)
|
||||||
def recover():
|
def recover():
|
||||||
# if we can't load profile, start with a new one
|
# if we can't load profile, start with a new one
|
||||||
|
if self.db:
|
||||||
|
try:
|
||||||
|
self.db.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
broken = path+".broken"
|
broken = path+".broken"
|
||||||
if os.path.exists(broken):
|
if os.path.exists(broken):
|
||||||
os.unlink(broken)
|
os.unlink(broken)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue