Survey -- Move To Trash function in Python?

Ian Kelly ian.g.kelly at gmail.com
Thu May 14 22:49:36 EDT 2015


On May 14, 2015 7:55 PM, "Chris Angelico" <rosuav at gmail.com> wrote:
> (Though when
> it comes to the bikeshedding phase, I'm sure there'll be some who say
> "if it can't be trashed, just hard delete it", and others who say "if
> it can't be trashed, raise an exception". And neither is truly wrong.)

The answer is "raise an exception". Moving to trash and deleting are
different operations, and one shouldn't be substituted for the other any
more than a failed attempt to create a hard link should create a soft link
instead.

If the user wants, they can catch the exception and delete the file
instead. Recovering from an accidental deletion would be more difficult.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150514/dd5142fb/attachment.html>


More information about the Python-list mailing list