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


Groups > comp.lang.python > #5839 > unrolled thread

Re: os.access giving incorrect results on Windows

Started byTim Golden <mail@timgolden.me.uk>
First post2011-05-20 09:21 +0100
Last post2011-05-20 09:21 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#5839 — Re: os.access giving incorrect results on Windows

FromTim Golden <mail@timgolden.me.uk>
Date2011-05-20 09:21 +0100
SubjectRe: os.access giving incorrect results on Windows
Message-ID<mailman.1831.1305879719.9059.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web