diff MoinMoin/caching.py @ 1429:1d55eff67af6

check for non-existing dir before calling os.makedirs
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 27 Aug 2006 01:32:14 +0200
parents 8a89649ab5f0
children 47a173ae5401
line wrap: on
line diff
--- a/MoinMoin/caching.py	Sun Aug 27 01:20:15 2006 +0200
+++ b/MoinMoin/caching.py	Sun Aug 27 01:32:14 2006 +0200
@@ -35,7 +35,6 @@
         if scope == 'page_or_wiki': # XXX DEPRECATED, remove later
             if isinstance(arena, str):
                 self.arena_dir = os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
-                os.makedirs(self.arena_dir)
             else: # arena is in fact a page object
                 self.arena_dir = arena.getPagePath('cache', check_create=1)
         elif scope == 'item': # arena is a Page instance
@@ -43,9 +42,9 @@
             self.arena_dir = arena.getPagePath('cache', check_create=1)
         elif scope == 'wiki':
             self.arena_dir = os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena)
-            os.makedirs(self.arena_dir)
         elif scope == 'farm':
             self.arena_dir = os.path.join(request.cfg.cache_dir, '__common__', arena)
+        if not os.path.exists(self.arena_dir):
             os.makedirs(self.arena_dir)
         if self.locking:
             self.lock_dir = os.path.join(self.arena_dir, '__lock__')