]> code.delx.au - offlineimap/commitdiff
Now create cur,new,tmp in '.' even if existsok is false
authorJohn Goerzen <jgoerzen@complete.org>
Sat, 2 Aug 2008 19:34:51 +0000 (14:34 -0500)
committerJohn Goerzen <jgoerzen@complete.org>
Sat, 2 Aug 2008 19:34:51 +0000 (14:34 -0500)
Otherwise, there was a race where sometimes subfolders would get created
first in the sep = '.' scneario

fixes #64

offlineimap/repository/Maildir.py

index 086d2d0b44db2c135bc695e1527f26445bc4d22a..717ffcbf64c9b51798d191bcdbe62a42ac96469f 100644 (file)
@@ -87,7 +87,7 @@ class MaildirRepository(BaseRepository):
         # makedirs will fail because the higher-up dir already exists.
         # So, check to see if this is indeed the case.
 
         # makedirs will fail because the higher-up dir already exists.
         # So, check to see if this is indeed the case.
 
-        if (self.getsep() == '/' or self.getconfboolean('existsok', 0)) \
+        if (self.getsep() == '/' or self.getconfboolean('existsok', 0) or foldername == '.') \
             and os.path.isdir(foldername):
             self.debug("makefolder: %s already is a directory" % foldername)
             # Already exists.  Sanity-check that it's not a Maildir.
             and os.path.isdir(foldername):
             self.debug("makefolder: %s already is a directory" % foldername)
             # Already exists.  Sanity-check that it's not a Maildir.