From 91afbbc28a909f14318b9cc8039334b8758ae6f3 Mon Sep 17 00:00:00 2001 From: alemidev Date: Mon, 25 Apr 2022 15:36:05 +0200 Subject: [PATCH] fallback to string --- src/treepuncher/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/treepuncher/storage.py b/src/treepuncher/storage.py index 686dc34..fc1fc26 100644 --- a/src/treepuncher/storage.py +++ b/src/treepuncher/storage.py @@ -87,6 +87,6 @@ class Storage: def put(self, key:str, val:Any) -> None: cur = self.db.cursor() cur.execute("DELETE FROM documents WHERE name = ?", (key,)) - cur.execute("INSERT INTO documents VALUES (?, ?)", (key, json.dumps(val))) + cur.execute("INSERT INTO documents VALUES (?, ?)", (key, json.dumps(val, default=str))) self.db.commit()