summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-03-19 02:42:40 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-03-19 02:42:40 +0000
commit1a6d98dab97df7e4bfc6fd9c82183eb9a1349078 (patch)
tree869ea8a655dc92e847fe7fc7a83a3c7a4ec1ed63 /django
parentbd0daa04f5c886c8eeebac0c48ef6a326cbf689e (diff)
Fixed #13686 -- Ensure that memcache handling of unicode values in add() and set_many() is consistent with the handling provided by get() and set(). Thanks to nedbatchelder for the report, and to jbalogh, accuser and Jacob Burch for their work ont the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15880 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/core/cache/backends/memcached.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/django/core/cache/backends/memcached.py b/django/core/cache/backends/memcached.py
index a40416d90d..c456f7f3c3 100644
--- a/django/core/cache/backends/memcached.py
+++ b/django/core/cache/backends/memcached.py
@@ -51,8 +51,6 @@ class BaseMemcachedCache(BaseCache):
def add(self, key, value, timeout=0, version=None):
key = self.make_key(key, version=version)
- if isinstance(value, unicode):
- value = value.encode('utf-8')
return self._cache.add(key, value, self._get_memcache_timeout(timeout))
def get(self, key, default=None, version=None):
@@ -118,8 +116,6 @@ class BaseMemcachedCache(BaseCache):
safe_data = {}
for key, value in data.items():
key = self.make_key(key, version=version)
- if isinstance(value, unicode):
- value = value.encode('utf-8')
safe_data[key] = value
self._cache.set_multi(safe_data, self._get_memcache_timeout(timeout))