os.access() problem

P

Phil Schmidt

I just got a new PC with Windows XP, and I want to run Leo on it. Leo
uses the os.access() function to check for read-only files. For some
reason, os.access(<filename>, os.W_OK) always returns false.

I wrote a 2-liner Python script to just test os.access on any file.
I have tried this with Python 2.4 and 2.5b1.
I have uninstalled and re-installed Python and Leo.
I have fiddled with file permissions on the target files as well as on
the Python installation itself.
I have used cacls to check the access control lists (and although I'm
not exactly certain what to do with this information, it appears to be
ok - I think).

None of the above has helped me to identify or fix the problem.

A scan of the Python newsgroup suggests that os.access() may not be the
best way to check for read-only, but the discussion is a bit deeper
than my understanding, so I'm not sure there's anything to it in this
case.

I realize this must be a Windows permissions thing, but I just can't
figure it out. I'm no expert in Windows security beyond basic
permissions, so I could be missing something simple. Can anyone offer
any suggestions?

Thanks,
Phil
 
L

Larry Bates

Phil said:
I just got a new PC with Windows XP, and I want to run Leo on it. Leo
uses the os.access() function to check for read-only files. For some
reason, os.access(<filename>, os.W_OK) always returns false.

I wrote a 2-liner Python script to just test os.access on any file.
I have tried this with Python 2.4 and 2.5b1.
I have uninstalled and re-installed Python and Leo.
I have fiddled with file permissions on the target files as well as on
the Python installation itself.
I have used cacls to check the access control lists (and although I'm
not exactly certain what to do with this information, it appears to be
ok - I think).

None of the above has helped me to identify or fix the problem.

A scan of the Python newsgroup suggests that os.access() may not be the
best way to check for read-only, but the discussion is a bit deeper
than my understanding, so I'm not sure there's anything to it in this
case.

I realize this must be a Windows permissions thing, but I just can't
figure it out. I'm no expert in Windows security beyond basic
permissions, so I could be missing something simple. Can anyone offer
any suggestions?

Thanks,
Phil
I just tested on Windows XP with ActiveState Python 2.4.1 and it works
as expected.
True

Changed file to read-only

FYI, Larry Bates
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,217
Latest member
topweb3twitterchannels

Latest Threads

Top