mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
dump error on profile load fail
may help diagnose https://forums.ankiweb.net/t/i-couldnt-open-anki-resetting-corrupt-global/190
This commit is contained in:
parent
04b1ca7559
commit
48b6510aef
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ import locale
|
||||||
import pickle
|
import pickle
|
||||||
import random
|
import random
|
||||||
import shutil
|
import shutil
|
||||||
|
import traceback
|
||||||
from typing import Any, Dict, List, Optional
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
from send2trash import send2trash
|
from send2trash import send2trash
|
||||||
|
@ -134,6 +135,7 @@ class ProfileManager:
|
||||||
except AnkiRestart:
|
except AnkiRestart:
|
||||||
raise
|
raise
|
||||||
except:
|
except:
|
||||||
|
print("migration failed")
|
||||||
self.base = newBase
|
self.base = newBase
|
||||||
shutil.move(oldBase, self.base)
|
shutil.move(oldBase, self.base)
|
||||||
|
|
||||||
|
@ -253,7 +255,7 @@ Anki could not read your profile data. Window sizes and your sync login \
|
||||||
details have been forgotten."""
|
details have been forgotten."""
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
traceback.print_stack()
|
||||||
print("resetting corrupt profile")
|
print("resetting corrupt profile")
|
||||||
self.profile = profileConf.copy()
|
self.profile = profileConf.copy()
|
||||||
self.save()
|
self.save()
|
||||||
|
@ -442,6 +444,7 @@ create table if not exists profiles
|
||||||
"select cast(data as blob) from profiles where name = '_global'"
|
"select cast(data as blob) from profiles where name = '_global'"
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
|
traceback.print_stack()
|
||||||
if result.loadError:
|
if result.loadError:
|
||||||
# already failed, prevent infinite loop
|
# already failed, prevent infinite loop
|
||||||
raise
|
raise
|
||||||
|
@ -455,6 +458,7 @@ create table if not exists profiles
|
||||||
self.meta = self._unpickle(data)
|
self.meta = self._unpickle(data)
|
||||||
return result
|
return result
|
||||||
except:
|
except:
|
||||||
|
traceback.print_stack()
|
||||||
print("resetting corrupt _global")
|
print("resetting corrupt _global")
|
||||||
result.loadError = True
|
result.loadError = True
|
||||||
result.firstTime = True
|
result.firstTime = True
|
||||||
|
|
Loading…
Reference in a new issue