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


Groups > comp.lang.python > #107858

Re: Why does pathlib not have is_readable() & things like that?

Path csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From eryk sun <eryksun@gmail.com>
Newsgroups comp.lang.python
Subject Re: Why does pathlib not have is_readable() & things like that?
Date Fri, 29 Apr 2016 10:09:41 -0500
Lines 16
Message-ID <mailman.225.1461942623.32212.python-list@python.org> (permalink)
References <6474vcx0q6.ln2@news.ducksburg.com> <1461679044.2467938.590028273.4DEA02AA@webmail.messagingengine.com> <mailman.106.1461679046.32212.python-list@python.org> <r8e9vcxf2a.ln2@news.ducksburg.com> <nft3h7$pbt$1@ger.gmane.org> <mailman.188.1461850479.32212.python-list@python.org> <manbvcxjkl.ln2@news.ducksburg.com> <lf5r3dor5ue.fsf@ling.helsinki.fi> <CACL+1avGZzy8e54RCHTqk4SNULTAcZMuQH_+L3m1OXx=Chs+4Q@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de IV++Tt3pjwIkWw5WMT4EbwGWJqpG3HQIqXrQIvK1TH4A==
Return-Path <eryksun@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'received:209.85.223': 0.03; 'security.': 0.09; 'skip:o 60': 0.09; 'subject:Why': 0.09; 'subject:not': 0.11; '2016': 0.16; 'adam': 0.16; 'read-only.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; '>>>': 0.20; 'windows': 0.20; 'proposed': 0.20; 'am,': 0.23; 'patch': 0.24; 'header:In-Reply-To:1': 0.24; 'error': 0.27; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'subject:that': 0.29; "i'm": 0.30; 'checks': 0.30; 'subject:like': 0.33; 'file': 0.34; 'received:google.com': 0.35; "isn't": 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'doing': 0.38; 'received:209': 0.38; 'to:addr:python.org': 0.40; 'subject:have': 0.80; 'low': 0.83; 'edwards': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=+KTo7+nBXHijw6XhNXkMhI+j+dzAQPHJqoG5tPPE+TM=; b=rg1K/BwSpH3DkRSbeZDRWTQE6a3hz0dkI/qZccI9+8S8uZ1SOSnFoWLokJJBelFY06 gkf3onxZSFwEqzglwTkIcIaQEUVrYYHSGvuGoYIMnceB2Y6LP2eUUgfIQSHyvwN7BndT Ux7jBCObjnxfEQ/zGHoW9D0mSaV/6CKI3WxobatmgtIHDMsBgvNdmITtUkfUWybTGzGB tAQDlOqGW231C1s0l49UPayFvdsdqvgZhzPs6xHcS+XI1DnuGoanVbkkHjUVV+aiv3hl j8LiNRYh6PMXVPHV0szTnq6nXjK7HCYfhMNYVJw5wzFni8wYD3d+MgAngyHSa6uzAh4b mljQ==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=+KTo7+nBXHijw6XhNXkMhI+j+dzAQPHJqoG5tPPE+TM=; b=DsiZKcWOZkkBBs9Fyz6N1bP+zmLAv+Lr5i5N8Xr3i/9hf+NawWWNwDgy+5D4rOsNFI 9JSjCYjq2hW/Vt9HDBB4mE31i4FOiVWRgnpVDDPUgKKSOxnI+GjjwIRfThjUkLyPWoRG TvL2H1Uhge+SBbLEPNejj0r0J+KzX2Qm3+LQliTyItCE8wrgqL+Fv4qYdFQvrdECTIJs GodzBM9kpPEQANQlrx2poFknHtKLKD1HYpbPRfVWfljSvCtPi2rNGzt3wCuKUCL8kuGo vZL3UZxivjAJtZ8CgscvPXd/hrvIBGOQoh+vvE35PRg4GEJTcmA2iWcAdZdaIx8UewVD 0uLQ==
X-Gm-Message-State AOPr4FVW9blvoajEK+rVKZC3dk4K+wxX9W6nw7mUt+rMahLsf1hOsExqKxQePakI5uro1CtVqQbJxHI9jZmVSQ==
X-Received by 10.107.55.138 with SMTP id e132mr20245425ioa.188.1461942621335; Fri, 29 Apr 2016 08:10:21 -0700 (PDT)
In-Reply-To <lf5r3dor5ue.fsf@ling.helsinki.fi>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <CACL+1avGZzy8e54RCHTqk4SNULTAcZMuQH_+L3m1OXx=Chs+4Q@mail.gmail.com>
X-Mailman-Original-References <6474vcx0q6.ln2@news.ducksburg.com> <1461679044.2467938.590028273.4DEA02AA@webmail.messagingengine.com> <mailman.106.1461679046.32212.python-list@python.org> <r8e9vcxf2a.ln2@news.ducksburg.com> <nft3h7$pbt$1@ger.gmane.org> <mailman.188.1461850479.32212.python-list@python.org> <manbvcxjkl.ln2@news.ducksburg.com> <lf5r3dor5ue.fsf@ling.helsinki.fi>
Xref csiph.com comp.lang.python:107858

Show key headers only | View raw


On Fri, Apr 29, 2016 at 6:51 AM, Jussi Piitulainen
<jussi.piitulainen@helsinki.fi> wrote:
> Adam Funk writes:
>> On 2016-04-28, Grant Edwards wrote:
>
>>> Or just do os.access("directory/where/you/want/to/open/a/file",os.W_OK)
>>
>> That's what I'm doing now, but I prefer to give the user the error
>> message early on.
>
> Then do that early on.

Note that on Windows os.access only checks if a file is read-only.
There's a proposed update to check the file security. The patch needs
to be updated and needs to be reworked, but it's a low priority. For
the most part calling os.access isn't recommended.

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


Thread

Why does pathlib not have is_readable() & things like that? Adam Funk <a24061@ducksburg.com> - 2016-04-26 14:30 +0100
  Re: Why does pathlib not have is_readable() & things like that? Random832 <random832@fastmail.com> - 2016-04-26 09:57 -0400
    Re: Why does pathlib not have is_readable() & things like that? Adam Funk <a24061@ducksburg.com> - 2016-04-28 14:02 +0100
      Re: Why does pathlib not have is_readable() & things like that? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-04-28 16:24 +0300
      Re: Why does pathlib not have is_readable() & things like that? Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-28 13:34 +0000
        Re: Why does pathlib not have is_readable() & things like that? Adam Funk <a24061@ducksburg.com> - 2016-04-29 10:49 +0100
          Re: Why does pathlib not have is_readable() & things like that? Jussi Piitulainen <jussi.piitulainen@helsinki.fi> - 2016-04-29 14:51 +0300
            Re: Why does pathlib not have is_readable() & things like that? eryk sun <eryksun@gmail.com> - 2016-04-29 10:09 -0500
            Re: Why does pathlib not have is_readable() & things like that? Grant Edwards <grant.b.edwards@gmail.com> - 2016-04-29 23:53 +0000
  Re: Why does pathlib not have is_readable() & things like that? Steven D'Aprano <steve@pearwood.info> - 2016-04-27 01:46 +1000
    Re: Why does pathlib not have is_readable() & things like that? Adam Funk <a24061@ducksburg.com> - 2016-04-28 13:57 +0100

csiph-web