mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26462 -- Fixed Python 2 UnicodeEncodeError when warning about long cache keys.
This commit is contained in:
committed by
Tim Graham
parent
369fa471f4
commit
90ce5d46bf
2
django/core/cache/backends/base.py
vendored
2
django/core/cache/backends/base.py
vendored
@@ -235,7 +235,7 @@ class BaseCache(object):
|
||||
"""
|
||||
if len(key) > MEMCACHE_MAX_KEY_LENGTH:
|
||||
warnings.warn('Cache key will cause errors if used with memcached: '
|
||||
'%s (longer than %s)' % (key, MEMCACHE_MAX_KEY_LENGTH),
|
||||
'%r (longer than %s)' % (key, MEMCACHE_MAX_KEY_LENGTH),
|
||||
CacheKeyWarning)
|
||||
for char in key:
|
||||
if ord(char) < 33 or ord(char) == 127:
|
||||
|
||||
Reference in New Issue
Block a user