Code

#18770 closed Bug (fixed)

MemcachedStringEncodingError

Reported by: thecore Owned by: claudep
Component: Core (Cache system) Version: master
Severity: Normal Keywords: cache
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by claudep)

After last updates of Django - python-memcached not work.
I have UTF-8 locale and 'ru-ru' locale setting. Python memcached not updated last time. I not set keys in manually.

Traceback:
File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py" in get_response
  92.                     response = middleware_method(request)
File "/usr/lib64/python2.7/site-packages/django/middleware/cache.py" in process_request
  143.         cache_key = get_cache_key(request, self.key_prefix, 'GET', cache=self.cache)
File "/usr/lib64/python2.7/site-packages/django/utils/cache.py" in get_cache_key
  211.     headerlist = cache.get(cache_key, None)
File "/usr/lib64/python2.7/site-packages/django/core/cache/backends/memcached.py" in get
  59.         val = self._cache.get(key)
File "build/bdist.linux-x86_64/egg/memcache.py" in get
  862.         return self._get('get', key)
File "build/bdist.linux-x86_64/egg/memcache.py" in _get
  813.         self.check_key(key)
File "build/bdist.linux-x86_64/egg/memcache.py" in check_key
  1014.                     "Keys must be str()'s, not unicode.  Convert your unicode "

Exception Type: MemcachedStringEncodingError at /
Exception Value: Keys must be str()'s, not unicode.  Convert your unicode strings using mystring.encode(charset)!

Attachments (0)

Change History (3)

comment:1 Changed 21 months ago by claudep

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to claudep
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

Reformatted, please use preview before posting.

comment:2 Changed 21 months ago by claudep

Current code is a bit unstable because of the added Python 3 compatibility. I will look to provide a fix.

comment:3 Changed 21 months ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In [4e17f4589accf5be0954eebc41d36ef96125d47c]:

Fixed #18770 -- memcached cache backend expects byte strings as keys

Thanks thecore for the report.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.