void-packages/srcpkgs/anki/patches/fix_profile_save.patch
Dmitry Zakharchenko 065953c8cd anki: fix type errors and profile saving.
Also, disable useless auto update dialog on start.
2021-11-17 17:23:50 +01:00

15 lines
498 B
Diff

Fixes crash related to saving profile data on exit.
--- a/aqt/profiles.py
+++ b/aqt/profiles.py
@@ -160,7 +160,10 @@ a flash drive.""" % self.base)
return up.load()
def _pickle(self, obj):
- return pickle.dumps(obj, protocol=0)
+ for key, val in obj.items():
+ if isinstance(val, QByteArray):
+ obj[key] = bytes(val) # type: ignore
+ return pickle.dumps(obj, protocol=4)
def load(self, name):
assert name != "_global"