mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
bump pickle proto to v4; change column type to blob
This commit is contained in:
parent
4b04905ff8
commit
17a221dfa0
1 changed files with 3 additions and 3 deletions
|
@ -240,8 +240,8 @@ class ProfileManager:
|
||||||
up = Unpickler(io.BytesIO(data), errors="ignore")
|
up = Unpickler(io.BytesIO(data), errors="ignore")
|
||||||
return up.load()
|
return up.load()
|
||||||
|
|
||||||
def _pickle(self, obj) -> Any:
|
def _pickle(self, obj) -> bytes:
|
||||||
return pickle.dumps(obj, protocol=0)
|
return pickle.dumps(obj, protocol=4)
|
||||||
|
|
||||||
def load(self, name) -> bool:
|
def load(self, name) -> bool:
|
||||||
assert name != "_global"
|
assert name != "_global"
|
||||||
|
@ -433,7 +433,7 @@ class ProfileManager:
|
||||||
self.db.execute(
|
self.db.execute(
|
||||||
"""
|
"""
|
||||||
create table if not exists profiles
|
create table if not exists profiles
|
||||||
(name text primary key, data text not null);"""
|
(name text primary key, data blob not null);"""
|
||||||
)
|
)
|
||||||
data = self.db.scalar(
|
data = self.db.scalar(
|
||||||
"select cast(data as blob) from profiles where name = '_global'"
|
"select cast(data as blob) from profiles where name = '_global'"
|
||||||
|
|
Loading…
Reference in a new issue