Jonathan Dowland added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20328>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to