Kaydet (Commit) c8dbc923 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

os.access now returns True on Windows for any existing directory.

üst 7cc9c8bb
...@@ -46,6 +46,8 @@ Core and builtins ...@@ -46,6 +46,8 @@ Core and builtins
Library Library
------- -------
- os.access now returns True on Windows for any existing directory.
- Issue #1531: tarfile.py: Read fileobj from the current offset, do not - Issue #1531: tarfile.py: Read fileobj from the current offset, do not
seek to the start. seek to the start.
......
...@@ -1535,8 +1535,11 @@ finish: ...@@ -1535,8 +1535,11 @@ finish:
/* File does not exist, or cannot read attributes */ /* File does not exist, or cannot read attributes */
return PyBool_FromLong(0); return PyBool_FromLong(0);
/* Access is possible if either write access wasn't requested, or /* Access is possible if either write access wasn't requested, or
the file isn't read-only. */ the file isn't read-only, or if it's a directory, as there are
return PyBool_FromLong(!(mode & 2) || !(attr & FILE_ATTRIBUTE_READONLY)); no read-only directories on Windows. */
return PyBool_FromLong(!(mode & 2)
|| !(attr & FILE_ATTRIBUTE_READONLY)
|| (attr & FILE_ATTRIBUTE_DIRECTORY));
#else #else
int res; int res;
if (!PyArg_ParseTuple(args, "eti:access", if (!PyArg_ParseTuple(args, "eti:access",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment