mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Forward-port r59310:
os.access now returns True on Windows for any existing directory.
This commit is contained in:
parent
e227263a6c
commit
7b3cc06a9a
2 changed files with 7 additions and 2 deletions
|
@ -1540,8 +1540,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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue