diff -urdN stock/python/Lib/test/test_os.py accessfix/python/Lib/test/test_os.py --- stock/python/Lib/test/test_os.py 2006-06-30 15:56:10.901480600 -0700 +++ accessfix/python/Lib/test/test_os.py 2006-06-30 16:04:27.750387400 -0700 @@ -29,6 +29,9 @@ open(name, "w") self.files.append(name) + def test_access(self): + self.assert_(os.access(test_support.TESTFN, os.W_OK)) + def test_tempnam(self): if not hasattr(os, "tempnam"): return diff -urdN stock/python/Modules/posixmodule.c accessfix/python/Modules/posixmodule.c --- stock/python/Modules/posixmodule.c 2006-06-30 16:00:08.082834500 -0700 +++ accessfix/python/Modules/posixmodule.c 2006-06-30 16:02:11.096216900 -0700 @@ -1402,7 +1402,7 @@ return PyBool_FromLong(0); /* Access is possible if either write access wasn't requested, or the file isn't read-only. */ - return PyBool_FromLong(!(mode & 2) || !(attr && FILE_ATTRIBUTE_READONLY)); + return PyBool_FromLong(!(mode & 2) || !(attr & FILE_ATTRIBUTE_READONLY)); #else int res; if (!PyArg_ParseTuple(args, "eti:access",