[issue24185] Add Function for Sending File to Trash (or Recycling Bin)

2016-05-09 Thread Stephen Paul Chappell

Changes by Stephen Paul Chappell :


--
nosy: +Zero

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24185] Add Function for Sending File to Trash (or Recycling Bin)

2015-05-13 Thread Taylor Marks

New submission from Taylor Marks:

When you have a file that you don't think you need anymore, the proper thing to 
do with it is move it to the Trash (or Recycling Bin, if you're on Windows.)

The standard library, however, doesn't offer any way of doing this currently. 
Instead, the only thing it offers is the ability to delete files. Deleting 
files is a potentially dangerous operation. A novice programmer may end up 
carelessly delete the wrong file.

I would suggest adding in a new function which allows for cross-platform moving 
of files to trash. It could go into the existing shutil or os modules. Or it 
could get its own module (like glob).

It could be based upon (or even be exactly) this implementation:
https://pypi.python.org/pypi/Send2Trash
https://github.com/hsoft/send2trash

Afterwards, the docs for os.remove and shutil.rmtree could have a warning added 
that suggests that instead of using such dangerous functions, it may be best 
for the user to use the new function.

(If this is not the place to propose additions to the standard library, please 
redirect me for where I should go instead. PEP 5 covers how the language should 
evolve, but then only has a link to bugs.python.org.)

--
components: Library (Lib)
messages: 243149
nosy: Taylor.Marks
priority: normal
severity: normal
status: open
title: Add Function for Sending File to Trash (or Recycling Bin)
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24185] Add Function for Sending File to Trash (or Recycling Bin)

2015-05-14 Thread R. David Murray

R. David Murray added the comment:

Heh, dangerous is in the eye of the beholder.  I don't even have a trash bin on 
my system (no desktop, just X and shell windows).  

It is almost always the case that an application written in python that wants 
to get rid of a file *does* want to really delete it, because it is not 
operating on user-facing files.  It is only when the program is implementing a 
GUI (and very occasionally when implementing a CLI) that it might want to move 
something to trash instead.

I'm -1 on this proposal.  Most python programs aren't GUI programs, so I don't 
think any significant fraction of python programs need it, and thus that the 
ones that do can just include it as a dependency along with all the other 
dependencies they need.  (Yes, you can write a full GUI just using tkinter, but 
the number of GUI programs that have no non-stdlib dependencies is probably 
quite small.)

This is the kind of thing that would need to go to python-ideas first in any 
case, so I'm going to close the issue.  If you get consensus that it is a good 
idea on the python-ideas mailing list, you can re-open the issue.

--
nosy: +r.david.murray
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24185] Add Function for Sending File to Trash (or Recycling Bin)

2015-05-14 Thread Steven D'Aprano

Steven D'Aprano added the comment:

This has been discussed on Python-Ideas some time ago, possibly more than once. 
See here for one such (short) discussion:

https://mail.python.org/pipermail/python-ideas/2013-April/020148.html

I think that move-to-trash functionality is quite useful, I needed something 
like that the other day, but there are at least two trash systems on Linux 
(although one is quite old and may not be used in recent systems), plus 
Windows, OS X, Android, iOS, etc. So it isn't a trivial piece of code, and it 
should spend some time as a third-party module first, at least until it reaches 
a stable and mature state.

Since it's been more than two years since the discussion above, perhaps it is 
worth considering it again (assuming that the library is stable and mature). 
Are you interested in taking this discussion to python-ideas?

--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24185] Add Function for Sending File to Trash (or Recycling Bin)

2015-05-14 Thread Virgil Dupras

Virgil Dupras added the comment:

For further references, there's also 
https://mail.python.org/pipermail/python-ideas/2014-December/030547.html which 
is a deeper discussion and brings even more arguments against it.

Even though I'd love to have some of my code integrated into the core, 
arguments against its inclusion are pretty strong.

--
nosy: +vdupras

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24185] Add Function for Sending File to Trash (or Recycling Bin)

2019-10-31 Thread Stephen Paul Chappell


Change by Stephen Paul Chappell :


--
nosy:  -Zero

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com