Author sblondon
Recipients sblondon
Date 2017-12-06.15:28:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512574106.47.0.213398074469.issue32234@psf.upfronthosting.co.za>
In-reply-to
Content
mailbox.Mailbox has a .close() method that should be called at the end of Mailbox use.
I think it would be nice to use Mailbox instances with a 'with' statement so .close() will be called it automatically. So there is no need to check for which format it's required (yes for mbox, no for Maildir, etc.)

So the source code:
mbox = mailbox.mbox("/path/to/mbox")
...
mbox.close()

could become:
with mailbox.mbox("/path/to/mbox") as mbox:
    ...
History
Date User Action Args
2017-12-06 15:28:26sblondonsetrecipients: + sblondon
2017-12-06 15:28:26sblondonsetmessageid: <1512574106.47.0.213398074469.issue32234@psf.upfronthosting.co.za>
2017-12-06 15:28:26sblondonlinkissue32234 messages
2017-12-06 15:28:26sblondoncreate