Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'scripts': 0.03; 'subject:Python': 0.06; 'linux,': 0.07; 'subject: -- ': 0.07; '"if': 0.09; 'differing': 0.09; 'inclusion': 0.09; 'things,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'gui': 0.12; "wouldn't": 0.14; 'windows': 0.15; '"move': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'itself,': 0.16; 'phase,': 0.16; 'presume': 0.16; 'subject:Move': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'library': 0.18; 'module': 0.19; 'written': 0.21; '>>>': 0.22; 'platforms': 0.22; 'cc:addr:python.org': 0.22; '(or': 0.24; 'cc:2**0': 0.24; '15,': 0.26; 'define': 0.26; 'certain': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'function': 0.29; 'leave': 0.29; 'am,': 0.29; 'raise': 0.29; 'unix': 0.29; 'locations': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'breaking': 0.31; "d'aprano": 0.31; 'steven': 0.31; 'way?': 0.31; 'file': 0.32; 'fri,': 0.33; "i'd": 0.34; 'could': 0.34; 'problem': 0.35; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'raising': 0.36; 'subject:?': 0.36; 'little': 0.38; 'anything': 0.39; 'supporting': 0.39; 'delete': 0.39; 'sure': 0.39; 'either': 0.39; 'major': 0.40; 'how': 0.40; 'even': 0.60; 'truly': 0.60; 'most': 0.60; 'free': 0.61; 'skip:t 30': 0.61; 'show': 0.63; 'such': 0.63; 'worth': 0.66; 'note:': 0.66; 'papers': 0.78; '2015': 0.84; 'survey,': 0.84; 'edwards': 0.91; 'error;': 0.91; 'subject:Survey': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=fLKcbI0xESoScpPv/FK9+VHoKPD3UlbaYX2/m96iZ0k=; b=AeY0kkpKDclUzjrl5lmLTtL4ioSncQ8CzJiHknELtROyOYYJL7LGedGT+zzt2qJTFN Eq/YGP1qwnB/lcvdOlF3v2gxfQ08E0dQCKnbloAbpjwhaxPMHQPy6QRsXfDKUFbG3YGT VRlHRtLqhdFhfXDvyYLWziwfHNfoiRqTGh+Uu6hCChgFRytzAqpjikbzkRs6qH5wQz5I 7gIaksFQzpV8E8C8++Oyj11L395S0E86yVqeu13eQDTIPSRzLxu8g/XZVQxbwZwgzNB1 g4a/srUeUk0E/Ji0YI/zOZA+8F7Igfwb/PINJ1ghQGag1CBB7GSQL06dwPCElfBgL3ED CEDw== MIME-Version: 1.0 X-Received: by 10.50.78.100 with SMTP id a4mr33894157igx.34.1431654785676; Thu, 14 May 2015 18:53:05 -0700 (PDT) In-Reply-To: <55554ddb$0$12995$c3e8da3$5496439d@news.astraweb.com> References: <5554c318$0$12999$c3e8da3$5496439d@news.astraweb.com> <55554ddb$0$12995$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 15 May 2015 11:53:05 +1000 Subject: Re: Survey -- Move To Trash function in Python? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 42 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1431654827 news.xs4all.nl 2965 [2001:888:2000:d::a6]:60506 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:90637 On Fri, May 15, 2015 at 11:37 AM, Steven D'Aprano wrote: > On Fri, 15 May 2015 01:49 am, Grant Edwards wrote: > >> On 2015-05-14, Steven D'Aprano >> wrote: >> >>> I'd like to do a little survey, and get a quick show of hands. >>> >>> How many people have written GUI or text-based applications or >>> scripts where a "Move file to trash" function would be useful? >> >> How would you even define what "move to trash" means in a standard >> way? > > There are standard locations for the trash on Linux, Windows and OS X. > > I presume that there are standard locations on the other main OSes, such as > Android, iOS, any Unix which supports the Free Desktop Standard(?), etc. > Anything else can either remain unsupported, or can use a caller-defined > location. > Point to note: Inclusion in the Python standard library would cement its *API*, but not its OS and desktop support. A call like trash.retrieve("oops_i_deleted_this") will either succeed or raise an error; it can change from raising to succeeding for a given platform without breaking anyone's code. So it wouldn't be a problem to start out supporting only the most major platforms (or not even all of them), and expand later. Much as I detest the operation itself, I do think this is something worth papering over. The multiprocessing module papers over a whole lot of platform quirks, and all we have left is "make sure your main module is importable if you use this on Windows"; a trashing module could deal with all the differing ways of trashing things, and leave us with "trashing may not work on certain file systems". (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.) ChrisA