Browse files

Merge pull request #18 from virhilo/master

Changed pickle protocol to 2
  • Loading branch information...
2 parents 171cea4 + 3fef504 commit 0c47a0fcb9a84f5be34ee44f346400c7f9629fcc @didip committed Mar 15, 2013
View
2 beaker_extensions/cassandra.py
@@ -47,7 +47,7 @@ def __contains__(self, key):
def set_value(self, key, value, expiretime=None):
key = self._format_key(key)
- self.cf.insert(key, {'data': pickle.dumps(value)}, ttl=expiretime)
+ self.cf.insert(key, {'data': pickle.dumps(value, 2)}, ttl=expiretime)
def __getitem__(self, key):
try:
View
2 beaker_extensions/nosql.py
@@ -57,7 +57,7 @@ def has_key(self, key):
return key in self
def set_value(self, key, value):
- self.db_conn[self._format_key(key)] = pickle.dumps(value)
+ self.db_conn[self._format_key(key)] = pickle.dumps(value, 2)
def __setitem__(self, key, value):
self.set_value(key, value)
View
4 beaker_extensions/redis_.py
@@ -54,9 +54,9 @@ def set_value(self, key, value, expiretime=None):
expiretime = value[1]
if expiretime:
- self.db_conn.setex(key, expiretime, pickle.dumps(value))
+ self.db_conn.setex(key, expiretime, pickle.dumps(value, 2))
else:
- self.db_conn.set(key, pickle.dumps(value))
+ self.db_conn.set(key, pickle.dumps(value, 2))
def __delitem__(self, key):
self.db_conn.delete(self._format_key(key))
View
2 beaker_extensions/ringo.py
@@ -27,7 +27,7 @@ def __getitem__(self, key):
return pickle.loads(self.db_conn.get(self.domain, self._format_key(key)))
def set_value(self, key, value):
- self.db_conn.put(self.domain, self._format_key(key), pickle.dumps(value))
+ self.db_conn.put(self.domain, self._format_key(key), pickle.dumps(value, 2))
def __delitem__(self, key):
raise Exception("Unimplemented")
View
2 beaker_extensions/tyrant_.py
@@ -24,7 +24,7 @@ def __contains__(self, key):
return self.db_conn.has_key(self._format_key(key))
def set_value(self, key, value):
- self.db_conn[self._format_key(key)] = pickle.dumps(value)
+ self.db_conn[self._format_key(key)] = pickle.dumps(value, 2)
def __delitem__(self, key):
del self.db_conn[self._format_key(key)]

0 comments on commit 0c47a0f

Please sign in to comment.