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

Skip to content

Commit 768f3b4

Browse files
committed
do not pretend to support passing a fd to access()
1 parent 9ed756b commit 768f3b4

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ Library
6262

6363
- Issue #26470: Port ssl and hashlib module to OpenSSL 1.1.0.
6464

65+
- Remove support for passing a file descriptor to os.access. It never worked but
66+
previously didn't raise.
67+
6568
- Issue #12885: Fix error when distutils encounters symlink.
6669

6770
- Issue #27881: Fixed possible bugs when setting sqlite3.Connection.isolation_level.

Modules/clinic/posixmodule.c.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ PyDoc_STRVAR(os_access__doc__,
9696
"Use the real uid/gid to test for access to a path.\n"
9797
"\n"
9898
" path\n"
99-
" Path to be tested; can be string, bytes, or open-file-descriptor int.\n"
99+
" Path to be tested; can be string or bytes\n"
100100
" mode\n"
101101
" Operating-system mode bitfield. Can be F_OK to test existence,\n"
102102
" or the inclusive-OR of R_OK, W_OK, and X_OK.\n"
@@ -132,7 +132,7 @@ os_access(PyObject *module, PyObject *args, PyObject *kwargs)
132132
{
133133
PyObject *return_value = NULL;
134134
static char *_keywords[] = {"path", "mode", "dir_fd", "effective_ids", "follow_symlinks", NULL};
135-
path_t path = PATH_T_INITIALIZE("access", "path", 0, 1);
135+
path_t path = PATH_T_INITIALIZE("access", "path", 0, 0);
136136
int mode;
137137
int dir_fd = DEFAULT_DIR_FD;
138138
int effective_ids = 0;
@@ -5784,4 +5784,4 @@ os_set_handle_inheritable(PyObject *module, PyObject *args)
57845784
#ifndef OS_SET_HANDLE_INHERITABLE_METHODDEF
57855785
#define OS_SET_HANDLE_INHERITABLE_METHODDEF
57865786
#endif /* !defined(OS_SET_HANDLE_INHERITABLE_METHODDEF) */
5787-
/*[clinic end generated code: output=c27221987f987cf3 input=a9049054013a1b77]*/
5787+
/*[clinic end generated code: output=9d5f831b23145d1e input=a9049054013a1b77]*/

Modules/posixmodule.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,8 +2517,8 @@ os_lstat_impl(PyObject *module, path_t *path, int dir_fd)
25172517
/*[clinic input]
25182518
os.access -> bool
25192519
2520-
path: path_t(allow_fd=True)
2521-
Path to be tested; can be string, bytes, or open-file-descriptor int.
2520+
path: path_t
2521+
Path to be tested; can be string or bytes
25222522
25232523
mode: int
25242524
Operating-system mode bitfield. Can be F_OK to test existence,
@@ -2556,7 +2556,7 @@ Note that most operations will use the effective uid/gid, therefore this
25562556
static int
25572557
os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd,
25582558
int effective_ids, int follow_symlinks)
2559-
/*[clinic end generated code: output=cf84158bc90b1a77 input=b75a756797af45ec]*/
2559+
/*[clinic end generated code: output=cf84158bc90b1a77 input=8e8c3a6ba791fee3]*/
25602560
{
25612561
int return_value;
25622562

0 commit comments

Comments
 (0)