Author: kmtracey
Date: 2011-12-25 11:44:20 -0800 (Sun, 25 Dec 2011)
New Revision: 17276

Modified:
   django/trunk/django/contrib/staticfiles/storage.py
Log:
Fixed #17462: Adjusted staticfiles CachedFilesMixin code so its tests pass on 
Windows.


Modified: django/trunk/django/contrib/staticfiles/storage.py
===================================================================
--- django/trunk/django/contrib/staticfiles/storage.py  2011-12-25 18:53:29 UTC 
(rev 17275)
+++ django/trunk/django/contrib/staticfiles/storage.py  2011-12-25 19:44:20 UTC 
(rev 17276)
@@ -102,7 +102,7 @@
             cache_key = self.cache_key(name)
             hashed_name = self.cache.get(cache_key)
             if hashed_name is None:
-                hashed_name = self.hashed_name(name)
+                hashed_name = self.hashed_name(name).replace('\\', '/')
                 # set the cache if there was a miss (e.g. if cache server goes 
down)
                 self.cache.set(cache_key, hashed_name)
         return unquote(super(CachedFilesMixin, self).url(hashed_name))
@@ -121,7 +121,7 @@
             # Completely ignore http(s) prefixed URLs
             if url.startswith(('http', 'https')):
                 return matched
-            name_parts = name.split('/')
+            name_parts = name.split(os.sep)
             # Using posix normpath here to remove duplicates
             url = posixpath.normpath(url)
             url_parts = url.split('/')

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to