Skip to content

Instantly share code, notes, and snippets.

@xlevus
Created May 26, 2010 04:03
Show Gist options
  • Save xlevus/414041 to your computer and use it in GitHub Desktop.
Save xlevus/414041 to your computer and use it in GitHub Desktop.
>>> from django import VERSION
>>> VERSION
(1, 1, 1, 'final', 0)
>>> import memcache
>>> memcache.__version__
'1.31'
>>>
>>> from django.core.cache import cache
>>> cache.set('test_key', u'\u2026')
>>> cache.get('test_key')
u'\u2026'
>>>
>>> from django import VERSION
>>> VERSION
(1, 2, 0, 'final', 0)
>>> import memcache
>>> memcache.__version__
'1.31'
>>>
>>> from django.core.cache import cache
>>> cache.set('test_key', u'\u2026')
Traceback (most recent call last):
File "<console>", line 1, in ?
File "/export/www/wwwroot/staging/django/staging6/code/valiant/core/cache/backends/prefix_wrapper.py", line 39, in set
return self.backend.set(key, value, timeout)
File "/export/www/wwwroot/staging/django/staging6/code/django/core/cache/backends/memcached.py", line 54, in set
self._cache.set(smart_str(key), value, self._get_memcache_timeout(timeout))
File "/usr/lib/python2.4/site-packages/memcache.py", line 293, in set
return self._set("set", key, val, time)
File "/usr/lib/python2.4/site-packages/memcache.py", line 317, in _set
server.send_cmd(fullcmd)
File "/usr/lib/python2.4/site-packages/memcache.py", line 507, in send_cmd
self.socket.sendall(cmd + '\r\n')
File "<string>", line 1, in sendall
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 40: ordinal not in range(128)
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment