memory(sqlite): fix encoding when loading pickled data
This commit is contained in:
parent
510e3e9bdc
commit
d22bd6c96d
1 changed files with 4 additions and 4 deletions
|
|
@ -706,12 +706,12 @@ class SqliteStorage(object):
|
|||
msg = failure_))
|
||||
|
||||
def _load_pickle(self, v):
|
||||
# FIXME: workaround for Python 3 port, some pickled data are byte while other are strings
|
||||
# FIXME: workaround for Python 3 port, some pickled data are bytes while other are strings
|
||||
try:
|
||||
return pickle.loads(v)
|
||||
return pickle.loads(v, encoding="utf-8")
|
||||
except TypeError:
|
||||
data = pickle.loads(v.encode('utf-8'))
|
||||
log.warning(f"encoding issue in pickled data: {data}")
|
||||
data = pickle.loads(v.encode('utf-8'), encoding="utf-8")
|
||||
log.debug(f"encoding issue in pickled data: {data}")
|
||||
return data
|
||||
|
||||
def _generateDataDict(self, query_result, binary):
|
||||
|
|
|
|||
Loading…
Reference in a new issue