summaryrefslogtreecommitdiff
path: root/django/utils/cache.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2011-12-27 08:22:55 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2011-12-27 08:22:55 +0000
commite8a6fee6e66f9745e2580b329c93e369801a8318 (patch)
tree6cdb93b6f0333ca5f3ef9ea84d2ee58096ff629f /django/utils/cache.py
parentb04578372930431827019a821ff946b36db3256d (diff)
Fixed a CacheKeyWarning under Windows.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/cache.py')
-rw-r--r--django/utils/cache.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/utils/cache.py b/django/utils/cache.py
index 1015c2f277..0ea84072fa 100644
--- a/django/utils/cache.py
+++ b/django/utils/cache.py
@@ -165,7 +165,9 @@ def _i18n_cache_key_suffix(request, cache_key):
# which in turn can also fall back to settings.LANGUAGE_CODE
cache_key += '.%s' % getattr(request, 'LANGUAGE_CODE', get_language())
if settings.USE_TZ:
- cache_key += '.%s' % get_current_timezone_name()
+ # Windows uses non-standard timezone names that may include spaces,
+ # which triggers CacheKeyWarning.
+ cache_key += '.%s' % get_current_timezone_name().replace(' ', '_')
return cache_key
def _generate_cache_key(request, method, headerlist, key_prefix):