Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b00324f

Browse files
committed
Merged revisions 59304-59312 via svnmerge from
svn+ssh://[email protected]/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. ........
1 parent e7fc50f commit b00324f

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

Doc/whatsnew/2.6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ PEP 343: The 'with' statement
108108

109109
The previous version, Python 2.5, added the ':keyword:`with`'
110110
statement an optional feature, to be enabled by a ``from __future__
111-
import with_statement`` directive. In 2.6 the statement no longer need to
111+
import with_statement`` directive. In 2.6 the statement no longer needs to
112112
be specially enabled; this means that :keyword:`with` is now always a
113113
keyword. The rest of this section is a copy of the corresponding
114114
section from "What's New in Python 2.5" document; if you read

Modules/posixmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,8 +1565,11 @@ posix_access(PyObject *self, PyObject *args)
15651565
/* File does not exist, or cannot read attributes */
15661566
return PyBool_FromLong(0);
15671567
/* Access is possible if either write access wasn't requested, or
1568-
the file isn't read-only. */
1569-
return PyBool_FromLong(!(mode & 2) || !(attr & FILE_ATTRIBUTE_READONLY));
1568+
the file isn't read-only, or if it's a directory, as there are
1569+
no read-only directories on Windows. */
1570+
return PyBool_FromLong(!(mode & 2)
1571+
|| !(attr & FILE_ATTRIBUTE_READONLY)
1572+
|| (attr & FILE_ATTRIBUTE_DIRECTORY));
15701573
#else
15711574
int res;
15721575
if (!PyArg_ParseTuple(args, "eti:access",

0 commit comments

Comments
 (0)