Ticket #4845: patch
File patch, 886 bytes (added by , 17 years ago) |
---|
-
memcached.py
16 16 self._cache = memcache.Client(server.split(';')) 17 17 18 18 def get(self, key, default=None): 19 val = self._cache.get(key )19 val = self._cache.get(key.encode('ascii', 'ignore')) 20 20 if val is None: 21 21 return default 22 22 else: 23 23 return val 24 24 25 25 def set(self, key, value, timeout=0): 26 self._cache.set(key , value, timeout or self.default_timeout)26 self._cache.set(key.encode('ascii', 'ignore'), value, timeout or self.default_timeout) 27 27 28 28 def delete(self, key): 29 self._cache.delete(key )29 self._cache.delete(key.encode('ascii', 'ignore')) 30 30 31 31 def get_many(self, keys): 32 32 return self._cache.get_multi(keys)