Assert error hint when trying to create MailDir root

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@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth 2011-06-06 11:37:24 +02:00 committed by Nicolas Sebrecht
parent 3dc9fc519a
commit f3ec6d9c7d

View File

@ -97,6 +97,7 @@ class MaildirRepository(BaseRepository):
(foldername, subdir)
else:
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']: