Ticket #4845: patch

File patch, 886 bytes (added by lethain@…, 17 years ago)
  • memcached.py

     
    1616        self._cache = memcache.Client(server.split(';'))
    1717
    1818    def get(self, key, default=None):
    19         val = self._cache.get(key)
     19        val = self._cache.get(key.encode('ascii', 'ignore'))
    2020        if val is None:
    2121            return default
    2222        else:
    2323            return val
    2424
    2525    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)
    2727
    2828    def delete(self, key):
    29         self._cache.delete(key)
     29        self._cache.delete(key.encode('ascii', 'ignore'))
    3030
    3131    def get_many(self, keys):
    3232        return self._cache.get_multi(keys)
Back to Top