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


Groups > comp.lang.python > #5839

Re: os.access giving incorrect results on Windows

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <mail@timgolden.me.uk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.01; 'beginner': 0.04; '3.2': 0.05; 'attributes': 0.05; ':-)': 0.06; 'interpreter': 0.07; 'read-only': 0.07; 'python': 0.08; 'attribute': 0.09; 'from:addr:timgolden.me.uk': 0.09; 'from:name:tim golden': 0.09; 'message-id:@timgolden.me.uk': 0.09; 'pm,': 0.10; 'wrote:': 0.14; 'confusing.': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'shot.': 0.16; 'wording': 0.16; 'appropriate.': 0.19; 'subject:Windows': 0.20; 'header:In-Reply-To:1': 0.21; 'seems': 0.21; 'commit': 0.22; 'code': 0.24; "doesn't": 0.25; 'saying': 0.26; 'windows': 0.26; "i'm": 0.27; 'raise': 0.28; 'do.': 0.30; 'fairly': 0.30; 'tjg': 0.30; 'entry': 0.31; 'url:library': 0.31; 'apply': 0.32; 'clearly': 0.32; 'andrew': 0.32; 'patch': 0.32; 'propose': 0.32; 'proposed': 0.32; 'does': 0.33; 'to:addr:python- list': 0.33; "isn't": 0.33; 'too': 0.33; 'file': 0.34; 'header :User-Agent:1': 0.35; 'fails': 0.35; 'here,': 0.35; 'else': 0.35; 'quite': 0.36; 'open': 0.36; 'running': 0.37; 'issue': 0.37; 'something': 0.37; 'url:docs': 0.37; 'case': 0.37; 'url:python': 0.38; 'could': 0.38; 'url:org': 0.38; 'but': 0.38; 'docs': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'received:192': 0.38; 'user': 0.39; 'got': 0.39; 'to:addr:python.org': 0.39; 'under': 0.40; 'more': 0.60; 'back': 0.63; 'from:addr:mail': 0.65; 'fit.': 0.67; 'golden': 0.67; 'care': 0.72; 'often.': 0.84; 'url:access': 0.84; 'url:os': 0.84; 'agreement.': 0.91; 'involved.': 0.91; 'something.': 0.91
Date Fri, 20 May 2011 09:21:54 +0100
From Tim Golden <mail@timgolden.me.uk>
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10
MIME-Version 1.0
To python-list@python.org
Subject Re: os.access giving incorrect results on Windows
References <21581D39FA3BDF40904D75AF9653CE2606567E4A@blrex.prog.altair.com> <4DD572FB.2010809@timgolden.me.uk> <4DD575E1.9060801@gmail.com> <4DD578AF.3000001@timgolden.me.uk> <4DD5803A.4080208@gmail.com>
In-Reply-To <4DD5803A.4080208@gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1831.1305879719.9059.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 82.94.164.166
X-Trace 1305879719 news.xs4all.nl 49180 [::ffff:82.94.164.166]:47737
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:5839

Show key headers only | View raw


On 19/05/2011 21:40, Andrew Berg wrote:
> On 2011.05.19 03:08 PM, Tim Golden wrote:
>> * A R_OK check always succeeds if the file's attributes can be read
>>     at all
> So is this the same as F_OK then, or does it return false if the user
> isn't allowed to read permissions?
>> * A W_OK check fails if the file has its DOS read-only attribute set
> DOS attribute?
>> * A W_OK check always succeeds for a directory (because read-only means
>>     something else for directories).
>>
>> Would you care to propose some wording for the docs? I'm quite happy
>> to commit if we can come to an agreement.
> I'm a beginner when it comes to Python, but I could give it a shot. A
> big red warning box explaining how the code under Windows doesn't use
> ACLs under the os.access() entry (above the notes) seems appropriate. A
> warning box under os.W_OK saying something like "Under Windows, access()
> will always indicate that a directory is writable." would also fit. You
> know more about this than I do. I'm running Windows 7 right now and I
> have a Python 3.2 interpreter window open if you want me to test/confirm
> something. :-)

(Sorry; just got back to this this morning). I might raise this on 
python-dev. It seems to me that the docs for os.access:

   http://docs.python.org/library/os.html#os.access

are already fairly involved. And we try not to make the official
docs too confusing. That said, there's clearly an issue here,
albeit one which doesn't raise its head too often.

There's a case for re-assessing the patch I proposed in issue2528
to see whether to apply it appropriately (reworked).

TJG

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


Thread

Re: os.access giving incorrect results on Windows Tim Golden <mail@timgolden.me.uk> - 2011-05-20 09:21 +0100

csiph-web