[Python-3000-checkins] r59313 - in python/branches/py3k: Doc/whatsnew/2.6.rst Modules/posixmodule.c
guido.van.rossum
python-3000-checkins at python.org
Tue Dec 4 02:13:14 CET 2007
Author: guido.van.rossum
Date: Tue Dec 4 02:13:14 2007
New Revision: 59313
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Doc/whatsnew/2.6.rst
python/branches/py3k/Modules/posixmodule.c
Log:
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.
........
Modified: python/branches/py3k/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/2.6.rst (original)
+++ python/branches/py3k/Doc/whatsnew/2.6.rst Tue Dec 4 02:13:14 2007
@@ -108,7 +108,7 @@
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
Modified: python/branches/py3k/Modules/posixmodule.c
==============================================================================
--- python/branches/py3k/Modules/posixmodule.c (original)
+++ python/branches/py3k/Modules/posixmodule.c Tue Dec 4 02:13:14 2007
@@ -1565,8 +1565,11 @@
/* 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",
More information about the Python-3000-checkins
mailing list