web/webconfig.py
changeset 8349 fdb796435d7b
parent 8259 1c5be4a1afd1
parent 8341 af813e7d5daa
child 8475 65fecbeb9c3a
--- a/web/webconfig.py	Thu Mar 29 14:20:41 2012 +0200
+++ b/web/webconfig.py	Tue Apr 10 17:03:19 2012 +0200
@@ -21,7 +21,7 @@
 _ = unicode
 
 import os
-from os.path import join, exists, split
+from os.path import join, exists, split, isdir
 from warnings import warn
 
 from logilab.common.decorators import cached
@@ -408,7 +408,8 @@
         rdir, filename = split(rpath)
         if rdir:
             staticdir = join(staticdir, rdir)
-            os.makedirs(staticdir)
+            if not isdir(staticdir) and 'w' in mode:
+                os.makedirs(staticdir)
         return file(join(staticdir, filename), mode)
 
     def static_file_add(self, rpath, data):