diff sat/memory/sqlite.py @ 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 67aebefb44fc
children 0ce37cf3fbf4
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: