changeset 3545:31cbcdd096a2

memory (sqlite): work around encoding issues with pickle
author Goffi <goffi@goffi.org>
date Fri, 04 Jun 2021 14:07:58 +0200
parents ae5f63e5ed2c
children 185601bc0cd3
files sat/memory/sqlite.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat/memory/sqlite.py	Thu Jun 03 17:59:41 2021 +0200
+++ b/sat/memory/sqlite.py	Fri Jun 04 14:07:58 2021 +0200
@@ -535,7 +535,7 @@
             if uid != current['uid']:
                 # new message
                 try:
-                    extra = pickle.loads(extra or b"")
+                    extra = self._load_pickle(extra or b"")
                 except EOFError:
                     extra = {}
                 current = {
@@ -1659,7 +1659,7 @@
                 log.info("preparing message {}/{}".format(idx, total))
             id_, timestamp, message, extra = row
             try:
-                extra = pickle.loads(str(extra or ""))
+                extra = self._load_pickle(extra or b"")
             except EOFError:
                 extra = {}
             except Exception: