Platform: Python 2.5b1 Windows XP Bug: os.access will report that a user doesn't have write permissions to a file or directory when the user actually does. Reproducibility: always This is being run on an administrator account. >>> import os >>> os.access("C:\\", os.W_OK) False >>> os.access("C:\\test.txt", os.W_OK) False I have also checked that Python can indeed write to the file.
Logged In: YES user_id=1081617 Yeah, it's only 2.5, and only 2.5b1. Basically, there's a double ampersand used instead of a single ampersand in posixmodule.c. I've attached the patch.
Logged In: YES user_id=33168 Your change looks correct, but I would really like a test case to fix this problem. I don't have access to a Windows box, so I can't verify the test fails before this patch and succeeds with it. Can you create a test case too? The best place to add the test would be Lib/test/test_posix.py. Thanks!