Folder could not be created

On Tue, Dec 13, 2011 at 12:00:57PM -0500, W. Trevor King wrote:
> I've attached a patch that does fix the problem…

Oops, *now* I've attached the patch and logs ;).

--
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

From 3067b1b4dfb00d165bd9480ea49f446adb12991d Mon Sep 17 00:00:00 2001
From: W. Trevor King <wking@drexel.edu>
Date: Tue, 13 Dec 2011 11:26:00 -0500
Subject: [PATCH] Only scan children in _getfolders_scandir if extension is set.

When sep is '/', MaildirRepository._getfolders_scandir recursively
checks sub-directories for additional maildirs.  The old loop logic
always checked the top directory and its children.  This lead to
children being found twice, once from their parent, with dirname
matching their directory name, and once from themselves, with a
dirname of ''.

This patch fixes the problem by only checking the top directory when
extension is not set (i.e. for the root directory).
This commit is contained in:
W. Trevor King 2011-12-13 12:04:19 -05:00 committed by Sebastian Spaeth
parent 87ebb3779a
commit 061712fe1c

View File

@ -150,6 +150,9 @@ class MaildirRepository(BaseRepository):
# Iterate over directories in top & top itself.
for dirname in os.listdir(toppath) + ['']:
self.debug(" dirname = %s" % dirname)
if dirname == '' and extension is not None:
self.debug(' skip this entry (extension set)')
continue
if dirname in ['cur', 'new', 'tmp']:
self.debug(" skipping this dir (Maildir special)")
# Bypass special files.