summaryrefslogtreecommitdiff
path: root/django/utils/cache.py
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2012-08-28 20:59:56 +0200
committerClaude Paroz <claude@2xlibre.net>2012-08-29 11:20:32 +0200
commitebc773ada3e4f40cf5084268387b873d7fe22e8b (patch)
tree88e136b190e480ed4c8c2310de408a268f4367b2 /django/utils/cache.py
parent9eafb6592e9ed27a59cb3cd9920c44cf230a6c65 (diff)
Replaced many smart_bytes by force_bytes
In all those occurrences, we didn't care about preserving the lazy status of the strings, but we really wanted to obtain a real bytestring.
Diffstat (limited to 'django/utils/cache.py')
-rw-r--r--django/utils/cache.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py
index 3e99833aa6..91c4796988 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -24,7 +24,7 @@ import time
from django.conf import settings
from django.core.cache import get_cache
-from django.utils.encoding import iri_to_uri, force_text, smart_bytes
+from django.utils.encoding import iri_to_uri, force_bytes, force_text
from django.utils.http import http_date
from django.utils.timezone import get_current_timezone_name
from django.utils.translation import get_language
@@ -181,14 +181,14 @@ def _generate_cache_key(request, method, headerlist, key_prefix):
value = request.META.get(header, None)
if value is not None:
ctx.update(value)
- path = hashlib.md5(smart_bytes(iri_to_uri(request.get_full_path())))
+ path = hashlib.md5(force_bytes(iri_to_uri(request.get_full_path())))
cache_key = 'views.decorators.cache.cache_page.%s.%s.%s.%s' % (
key_prefix, method, path.hexdigest(), ctx.hexdigest())
return _i18n_cache_key_suffix(request, cache_key)
def _generate_cache_header_key(key_prefix, request):
"""Returns a cache key for the header cache."""
- path = hashlib.md5(smart_bytes(iri_to_uri(request.get_full_path())))
+ path = hashlib.md5(force_bytes(iri_to_uri(request.get_full_path())))
cache_key = 'views.decorators.cache.cache_header.%s.%s' % (
key_prefix, path.hexdigest())
return _i18n_cache_key_suffix(request, cache_key)