summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-12-04 01:13:14 (GMT)
committerGuido van Rossum <guido@python.org>2007-12-04 01:13:14 (GMT)
commitb00324f9b45c677def6c9248ba49ccd56f738beb (patch)
treea9607b709cefd50bb9074675ae99ca25e5abfc1d /Modules
parente7fc50f2d03a6b62e4b4201c89b2c0185c90f697 (diff)
downloadcpython-b00324f9b45c677def6c9248ba49ccd56f738beb.zip
cpython-b00324f9b45c677def6c9248ba49ccd56f738beb.tar.gz
cpython-b00324f9b45c677def6c9248ba49ccd56f738beb.tar.bz2
Merged revisions 59304-59312 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59306 | andrew.kuchling | 2007-12-03 13:28:41 -0800 (Mon, 03 Dec 2007) | 1 line Grammar fix ........ r59307 | guido.van.rossum | 2007-12-03 14:02:10 -0800 (Mon, 03 Dec 2007) | 2 lines Shut up a compiler warning. ........ r59312 | martin.v.loewis | 2007-12-03 15:09:04 -0800 (Mon, 03 Dec 2007) | 3 lines Forward-port r59310: os.access now returns True on Windows for any existing directory. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index c36b712..92a8b28 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1565,8 +1565,11 @@ finish:
/* File does not exist, or cannot read attributes */
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));
+ the file isn't read-only, or if it's a directory, as there are
+ no read-only directories on Windows. */
+ return PyBool_FromLong(!(mode & 2)
+ || !(attr & FILE_ATTRIBUTE_READONLY)
+ || (attr & FILE_ATTRIBUTE_DIRECTORY));
#else
int res;
if (!PyArg_ParseTuple(args, "eti:access",