changeset 436:5e9d28ca5109

core: sqlite persistentBinaryDict storage fix
author Goffi <goffi@goffi.org>
date Wed, 30 Nov 2011 00:23:50 +0100
parents c243f4cb2ad9
children 02c633a0ddcf
files src/memory/sqlite.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/memory/sqlite.py	Sun Nov 20 15:56:51 2011 +0100
+++ b/src/memory/sqlite.py	Wed Nov 30 00:23:50 2011 +0100
@@ -302,9 +302,9 @@
         def fillPrivates(result):
             for private in result:
                 key,value = private
-                private_gen[key] = pickle.loads(value,0)
+                private_gen[key] = pickle.loads(str(value))
         debug(_("loading general private binary values [namespace: %s] from database") % (namespace,)) 
-        d = self.dbpool.runQuery("SELECT key,value FROM private_gen_bin WHERE namespace=?", namespace).addCallback(fillPrivates)
+        d = self.dbpool.runQuery("SELECT key,value FROM private_gen_bin WHERE namespace=?", (namespace,)).addCallback(fillPrivates)
         return d.addErrback(lambda x: debug(_("No binary data present in database for namespace %s") % namespace))
 
     def loadIndPrivatesBinary(self, private_ind, namespace, profile):
@@ -316,7 +316,7 @@
         def fillPrivates(result):
             for private in result:
                 key,value = private
-                private_ind[key] = pickle.loads(value,0)
+                private_ind[key] = pickle.loads(str(value))
         debug(_("loading individual private binary values [namespace: %s] from database") % (namespace,))
         d = self.dbpool.runQuery("SELECT key,value FROM private_ind_bin WHERE namespace=? AND profile_id=?", (namespace, self.profiles[profile]))
         d.addCallback(fillPrivates)