Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #90642

Re: Survey -- Move To Trash function in Python?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!bcyclone03.am1.xlned.com!bcyclone03.am1.xlned.com!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.044
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'subject:Python': 0.06; 'subject: -- ': 0.07; '"if': 0.09; 'deletion': 0.16; 'phase,': 0.16; 'subject:Move': 0.16; 'substituted': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'email addr:gmail.com&gt;': 0.22; 'instead.': 0.24; "shouldn't": 0.24; '&gt;': 0.26; 'header:In- Reply-To:1': 0.27; 'raise': 0.29; 'operations,': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'file': 0.32; "can't": 0.35; 'received:google.com': 0.35; '14,': 0.36; 'subject:?': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'moving': 0.39; 'delete': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'catch': 0.60; 'deleting': 0.60; 'truly': 0.60; 'more': 0.64; 'different': 0.65; '2015': 0.84; 'subject:Survey': 0.91
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:to :content-type; bh=8hta59vz46NIL13YrxXJboVmzNviKdgsJ35QPMaqKU8=; b=yLytcH2NMMu113stqdINIjymiiWwC7VC6zQmbjBirNKwS6xS3fbITjNo1oUyt6pJNs Q+65Bsx6ZdbqYjvQYCHB6v4vaazIRbmR4F48HVYNFODy+w2JY3pYXjZ2VvSN4hxPeN9d CGhc2Tv1li+jjQ7iIiz732+IC6RnAGa35bE5+Hl5ISJC+SWWT1scxoQPmx/YU9GzEMOi 7eSmJVTShohgXynKCSyf9ydlTcxa+Pd4RzYpOjdplLlvgtey89Ejz+ON6O3mObnFWsDT x0m+/0gv7TsOc7lck+S+RHTQSPySYmVn8cMe1UWfc8qPO+1B6N4FAC+htEgt0oBbAmVL Xh9g==
MIME-Version 1.0
X-Received by 10.50.30.69 with SMTP id q5mr10763019igh.11.1431658177002; Thu, 14 May 2015 19:49:37 -0700 (PDT)
In-Reply-To <CAPTjJmokNo3e1=LEBBnC_6zQmtP=Smh7bXm-uCsGEew4sKZ52Q@mail.gmail.com>
References <5554c318$0$12999$c3e8da3$5496439d@news.astraweb.com> <mj2g70$eij$1@reader1.panix.com> <55554ddb$0$12995$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmokNo3e1=LEBBnC_6zQmtP=Smh7bXm-uCsGEew4sKZ52Q@mail.gmail.com>
Date Thu, 14 May 2015 20:49:36 -0600
Subject Re: Survey -- Move To Trash function in Python?
From Ian Kelly <ian.g.kelly@gmail.com>
To Python <python-list@python.org>
Content-Type multipart/alternative; boundary=047d7bdc1c0c1480d7051615e5c5
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.22.1431658180.17265.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1431658180 news.xs4all.nl 2890 [2001:888:2000:d::a6]:50859
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 5000
X-Received-Body-CRC 1961297318
Xref csiph.com comp.lang.python:90642

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On May 14, 2015 7:55 PM, "Chris Angelico" <rosuav@gmail.com> wrote:
> (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.)

The answer is "raise an exception". Moving to trash and deleting are
different operations, and one shouldn't be substituted for the other any
more than a failed attempt to create a hard link should create a soft link
instead.

If the user wants, they can catch the exception and delete the file
instead. Recovering from an accidental deletion would be more difficult.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 01:45 +1000
  Re: Survey -- Move To Trash function in Python? Grant Edwards <invalid@invalid.invalid> - 2015-05-14 15:49 +0000
    Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 01:59 +1000
      Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 12:28 +1000
    Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 11:37 +1000
      Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 11:53 +1000
      Re: Survey -- Move To Trash function in Python? Ian Kelly <ian.g.kelly@gmail.com> - 2015-05-14 20:49 -0600
      Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 12:56 +1000
        Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 14:09 +1000
          Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-15 14:25 +1000
          Re: Survey -- Move To Trash function in Python? random832@fastmail.us - 2015-05-15 14:27 -0400
            Re: Survey -- Move To Trash function in Python? sohcahtoa82@gmail.com - 2015-05-15 17:04 -0700
          Re: Survey -- Move To Trash function in Python? Chris Angelico <rosuav@gmail.com> - 2015-05-16 04:33 +1000
  Re: Survey -- Move To Trash function in Python? Dave Farrance <DaveFarrance@OMiTTHiSyahooANDTHiS.co.uk> - 2015-05-14 18:32 +0100
    Re: Survey -- Move To Trash function in Python? Grant Edwards <invalid@invalid.invalid> - 2015-05-14 18:11 +0000
      Re: Survey -- Move To Trash function in Python? Chris Warrick <kwpolska@gmail.com> - 2015-05-14 20:43 +0200
      Re: Survey -- Move To Trash function in Python? Ethan Furman <ethan@stoneleaf.us> - 2015-05-14 12:32 -0700
    Re: Survey -- Move To Trash function in Python? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-15 12:03 +1000
      Re: Survey -- Move To Trash function in Python? Terry Reedy <tjreedy@udel.edu> - 2015-05-14 22:27 -0400
  Re: Survey -- Move To Trash function in Python? Ethan Furman <ethan@stoneleaf.us> - 2015-05-14 11:29 -0700
  Re: Survey -- Move To Trash function in Python? iMath <redstone-cold@163.com> - 2015-05-18 03:31 -0700
    Re: Survey -- Move To Trash function in Python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-18 14:46 +0100

csiph-web