This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author moyix
Recipients moyix
Date 2011-04-04.23:11:08
SpamBayes Score 0.00049072044
Marked as misclassified No
Message-id <1301958670.39.0.218079408331.issue11767@psf.upfronthosting.co.za>
In-reply-to
Content
The default constructor for Maildir is rfc822.Message. This means that when iterating over a Maildir mailbox instantiated with default settings, the Mailbox class will return self._factory(self.get_file(key)), leaking the file descriptor returned by get_file(). Thus, iterating over any reasonably sized maildir mailbox will cause file descriptors to be leaked, and if a non-refcounting GC is used (as in PyPy), it is very likely that the process will run out of file descriptors.

I see that the default has changed to None, for Py3k, but this still means that using a message factory unavoidably leaks file descriptors. Ideally, I'd like the Mailbox class to close the file descriptor passed into the factory; this would mean that file descriptors are never leaked during iteration.
History
Date User Action Args
2011-04-04 23:11:10moyixsetrecipients: + moyix
2011-04-04 23:11:10moyixsetmessageid: <1301958670.39.0.218079408331.issue11767@psf.upfronthosting.co.za>
2011-04-04 23:11:08moyixlinkissue11767 messages
2011-04-04 23:11:08moyixcreate