Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #17462: Adjusted staticfiles CachedFilesMixin code so its tests…

… pass on Windows.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17276 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b04578372930431827019a821ff946b36db3256d 1 parent 5df784a
Karen Tracey authored December 25, 2011

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/contrib/staticfiles/storage.py
4  django/contrib/staticfiles/storage.py
@@ -102,7 +102,7 @@ def url(self, name, force=False):
102 102
             cache_key = self.cache_key(name)
103 103
             hashed_name = self.cache.get(cache_key)
104 104
             if hashed_name is None:
105  
-                hashed_name = self.hashed_name(name)
  105
+                hashed_name = self.hashed_name(name).replace('\\', '/')
106 106
                 # set the cache if there was a miss (e.g. if cache server goes down)
107 107
                 self.cache.set(cache_key, hashed_name)
108 108
         return unquote(super(CachedFilesMixin, self).url(hashed_name))
@@ -121,7 +121,7 @@ def converter(matchobj):
121 121
             # Completely ignore http(s) prefixed URLs
122 122
             if url.startswith(('http', 'https')):
123 123
                 return matched
124  
-            name_parts = name.split('/')
  124
+            name_parts = name.split(os.sep)
125 125
             # Using posix normpath here to remove duplicates
126 126
             url = posixpath.normpath(url)
127 127
             url_parts = url.split('/')

0 notes on commit b045783

Please sign in to comment.
Something went wrong with that request. Please try again.