[PATCHv2 1/2] Assert error hint when trying to create MailDir root

Sebastian Spaeth Sebastian at SSpaeth.de
Mon Jun 6 10:37:24 BST 2011

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499755 shows the
cryptic output we have when, e.g. trying to put somethin in our mailDir
root via the nametrans options. This commit adds at least some hint as
to what went wrong using an "assert" message, although the correct thing
is to allow the creation of a maildir in the root folder.

Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
v2, splitting the error reporting off as requested by Nicolas.

 offlineimap/repository/Maildir.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py
index 0af4d1f..18fa591 100644
--- a/offlineimap/repository/Maildir.py
+++ b/offlineimap/repository/Maildir.py
@@ -97,6 +97,7 @@ class MaildirRepository(BaseRepository):
                        (foldername, subdir)
             self.debug("makefolder: calling makedirs %s" % foldername)
+            assert foldername != '', "Can not create root MailDir."
             os.makedirs(foldername, 0700)
         self.debug("makefolder: creating cur, new, tmp")
         for subdir in ['cur', 'new', 'tmp']:

More information about the OfflineIMAP-project mailing list