This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Taylor.Marks
Recipients Taylor.Marks
Date 2015-05-14.03:36:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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:

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
Date User Action Args
2015-05-14 03:36:41Taylor.Markssetrecipients: + Taylor.Marks
2015-05-14 03:36:41Taylor.Markssetmessageid: <>
2015-05-14 03:36:41Taylor.Markslinkissue24185 messages
2015-05-14 03:36:40Taylor.Markscreate