[Python-ideas] Adding `pathlib.Path` method that would send file to recycle bin

Ronald Oussoren ronaldoussoren at mac.com
Tue Dec 30 22:43:06 CET 2014


> On 30 Dec 2014, at 21:33, random832 at fastmail.us wrote:
> 
> On Mon, Dec 29, 2014, at 18:46, Andrew Barnert wrote:
>> I believe all of those issues could just raise the normal exception,
>> because Finder treats them as normal errors--that is, rather than giving
>> you the special "can't trash; delete?" message, it tries, fails, asks you
>> to authenticate as an administrator, and tries again.
> 
> That doesn't make sense - the problem is with the state of the trash
> directory (it may be in a state that you can access, but the "wrong"
> one, e.g. one that would allow other people to delete your files - I
> don't know if this is a problem for OSX but it is for XDG), not your
> access to the file being deleted.

On OSX there are at least two reasons why the Finder can prompt you
when you try to move a file to the trash. The first is a source location that doesn’t 
support the trash (such as a fileserver), the Finder will ask if should just
permanently remove the file. The second is when you don’t have permissions to
remove the file, the Finder will then ask if it should retry with Administrator
privileges (and will prompt you for a username and password if you confirm).

Ronald



More information about the Python-ideas mailing list