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

Nick Coghlan ncoghlan at gmail.com
Sat Jan 3 02:36:01 CET 2015

On 3 Jan 2015 06:06, "Andrew Barnert" <abarnert at yahoo.com.dmarc.invalid>
> Except that if you can't create a .Trash-$uid, then you can't trash files
on that filesystem even though Nautilus, etc. can. (And, needless to say,
if you try to implement any other trash functionality, like listing trash
contents or undeleting, you're going to be wrong there too.)

It sounds to me that what is needed before changes to pathlib can be
discussed is a reference third party module that appropriately respects
desktop conventions (whether Windows, Mac OS X, GNOME, KDE, or other XDG
based Linux window manager), and associated clear documentation on how to
delete files in a way that integrates well with underlying platforms.

The standard library isn't the place to work through that standardisation
activity, although a PEP is certainly a reasonable place to track it.
Guido's work on PEP 3156 and the asnycio module is a good point of
reference here, as is Antoine's work on pathlib itself.

Once a pathlib independent reference implementation of imperative desktop
trash management exists, and there is broad acknowledgement that it is a
suitable candidate for inclusion in the standard library (perhaps as part
of shutil, perhaps as a new independent module, depending on API
complexity), *then* it becomes feasible to discuss adding trash management
support to the pathlib abstraction layer.


> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150103/f6ae6eb8/attachment-0001.html>

More information about the Python-ideas mailing list