Ticket #8410: patch-django.core.backends.memcached-8410.diff
File patch-django.core.backends.memcached-8410.diff, 684 bytes (added by , 16 years ago) |
---|
-
django/core/cache/backends/memcached.py
diff -r 79b314cf895d django/core/cache/backends/memcached.py
a b 17 17 self._cache = memcache.Client(server.split(';')) 18 18 19 19 def add(self, key, value, timeout=0): 20 self._cache.add(key.encode('ascii', 'ignore'), value, timeout or self.default_timeout) 20 if isinstance(value, unicode): 21 value = value.encode('utf-8') 22 self._cache.add(smart_str(key), value, timeout or self.default_timeout) 21 23 22 24 def get(self, key, default=None): 23 25 val = self._cache.get(smart_str(key))