From f9217102f37b0bacc57853091142f0db0f8e359c Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 25 Nov 2017 19:58:14 +0100 Subject: [PATCH] crawler: fix sqlite/binary issue --- morss/crawler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/morss/crawler.py b/morss/crawler.py index 14ba904..0d44d99 100644 --- a/morss/crawler.py +++ b/morss/crawler.py @@ -494,6 +494,10 @@ class SQLiteCache(BaseCache): return row[1:] def __setitem__(self, url, value): # value = (code, msg, headers, data, timestamp) + value = list(value) + value[3] = sqlite3.Binary(value[3]) # data + value = tuple(value) + if url in self: with self.con: self.con.execute('UPDATE data SET code=?, msg=?, headers=?, data=?, timestamp=? WHERE url=?',