summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/whatsnew/2.6.rst2
-rw-r--r--Modules/posixmodule.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
index 0c3c694..3a0096c 100644
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -108,7 +108,7 @@ PEP 343: The 'with' statement
The previous version, Python 2.5, added the ':keyword:`with`'
statement an optional feature, to be enabled by a ``from __future__
-import with_statement`` directive. In 2.6 the statement no longer need to
+import with_statement`` directive. In 2.6 the statement no longer needs to
be specially enabled; this means that :keyword:`with` is now always a
keyword. The rest of this section is a copy of the corresponding
section from "What's New in Python 2.5" document; if you read
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",