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 jmtd
Recipients barry, jmtd, r.david.murray
Date 2014-08-19.20:30:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1408480211.32.0.526230062123.issue20328@psf.upfronthosting.co.za>
In-reply-to
Content
Hi David, whilst writing my patch I've tried to keep an open mind as to users of the methods, but I do have my own purpose in the back of my mind, and that's an archive mail tool which I would like to delete mail folders if, after performing an archive operation, they are empty. However, the archive mail tool has no awareness or interest in sub-folders. The user would be surprised, however, if it deleted them, should they exist.

There's also the issue of lack of locks for Maildirs. If one wanted to avoid recursive deleting, how could one achieve it? consider pseudo code

if len(mbox.list_folders()) <= 0:
  # no sub-folders, safe to delete?
  mbox.delete()

There are no guarantees an external process didn't create a sub folder between the test and the delete operation.

Finally, if one has a delete() operation that doesn't operate on sub-folders, but you want to recursively delete, you can at least assemble such a method. If you have a recursively-deleting method, and you *don't* want to delete sub-folders, you're stuck.

Having said all that please let me know what you're thinking; I'll happily try to cook up a patch to add both recursive and non-recursive delete methods.
History
Date User Action Args
2014-08-19 20:30:11jmtdsetrecipients: + jmtd, barry, r.david.murray
2014-08-19 20:30:11jmtdsetmessageid: <1408480211.32.0.526230062123.issue20328@psf.upfronthosting.co.za>
2014-08-19 20:30:11jmtdlinkissue20328 messages
2014-08-19 20:30:10jmtdcreate