void-packages/srcpkgs/anki/patches/fix_profile_save.patch

16 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"