Django

Code

Changeset 8444

Show
Ignore:
Timestamp:
08/19/08 15:35:56 (3 months ago)
Author:
mtredinnick
Message:

Fixed #8410 -- Added a missing piece of value encoding for the memcached
backend. Patch from trbs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/cache/backends/memcached.py

    r8418 r8444  
    1818 
    1919    def add(self, key, value, timeout=0): 
    20         return 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        return self._cache.add(smart_str(key), value, timeout or self.default_timeout) 
    2123 
    2224    def get(self, key, default=None):