changeset 1430:fd7166892bd3

check for non-existing dir before calling os.makedirs
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 27 Aug 2006 01:41:02 +0200
parents 1d55eff67af6
children 0a9763e325d1
files MoinMoin/auth/smb_mount.py MoinMoin/search/builtin.py MoinMoin/user.py
diffstat 3 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/smb_mount.py	Sun Aug 27 01:32:14 2006 +0200
+++ b/MoinMoin/auth/smb_mount.py	Sun Aug 27 01:41:02 2006 +0200
@@ -52,7 +52,8 @@
         env = os.environ.copy()
         if login:
             try:
-                os.makedirs(mountpoint) # the dir containing the mountpoint must be writeable for us!
+                if not os.path.exists(mountpoint):
+                    os.makedirs(mountpoint) # the dir containing the mountpoint must be writeable for us!
             except OSError, err:
                 pass
             env['PASSWD'] = password.encode(cfg.smb_coding)
--- a/MoinMoin/search/builtin.py	Sun Aug 27 01:32:14 2006 +0200
+++ b/MoinMoin/search/builtin.py	Sun Aug 27 01:41:02 2006 +0200
@@ -144,7 +144,8 @@
         cache_dir = request.cfg.cache_dir
         main_dir = self._main_dir()
         self.dir = os.path.join(main_dir, 'index')
-        os.makedirs(self.dir)
+        if not os.path.exists(self.dir):
+            os.makedirs(self.dir)
         self.sig_file = os.path.join(main_dir, 'complete')
         lock_dir = os.path.join(main_dir, 'index-lock')
         self.lock = lock.WriteLock(lock_dir,
--- a/MoinMoin/user.py	Sun Aug 27 01:32:14 2006 +0200
+++ b/MoinMoin/user.py	Sun Aug 27 01:41:02 2006 +0200
@@ -503,7 +503,8 @@
             return
 
         user_dir = self._cfg.user_dir
-        os.makedirs(user_dir)
+        if not os.path.exists(user_dir):
+            os.makedirs(user_dir)
 
         self.last_saved = str(time.time())