Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 4459e00

Browse files
committed
Issue python#29092: Sync os.stat's doc and docstring on path type.
2 parents a203360 + d7d87ca commit 4459e00

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,7 @@ features:
22132213

22142214
Get the status of a file or a file descriptor. Perform the equivalent of a
22152215
:c:func:`stat` system call on the given path. *path* may be specified as
2216-
either a string -- directly or indirectly through the :class:`PathLike`
2216+
either a string or bytes -- directly or indirectly through the :class:`PathLike`
22172217
interface -- or as an open file descriptor. Return a :class:`stat_result`
22182218
object.
22192219

Modules/clinic/posixmodule.c.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ PyDoc_STRVAR(os_stat__doc__,
99
"Perform a stat system call on the given path.\n"
1010
"\n"
1111
" path\n"
12-
" Path to be examined; can be string, bytes, or open-file-descriptor int.\n"
12+
" Path to be examined; can be string, bytes, path-like object or\n"
13+
" open-file-descriptor int.\n"
1314
" dir_fd\n"
1415
" If not None, it should be a file descriptor open to a directory,\n"
1516
" and path should be a relative string; path will then be relative to\n"
@@ -6149,4 +6150,4 @@ os_getrandom(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwna
61496150
#ifndef OS_GETRANDOM_METHODDEF
61506151
#define OS_GETRANDOM_METHODDEF
61516152
#endif /* !defined(OS_GETRANDOM_METHODDEF) */
6152-
/*[clinic end generated code: output=50cfb7ebc44efb67 input=a9049054013a1b77]*/
6153+
/*[clinic end generated code: output=455def991740915a input=a9049054013a1b77]*/

Modules/posixmodule.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,7 +2386,8 @@ class sched_param_converter(CConverter):
23862386
os.stat
23872387
23882388
path : path_t(allow_fd=True)
2389-
Path to be examined; can be string, bytes, or open-file-descriptor int.
2389+
Path to be examined; can be string, bytes, path-like object or
2390+
open-file-descriptor int.
23902391
23912392
*
23922393
@@ -2413,7 +2414,7 @@ It's an error to use dir_fd or follow_symlinks when specifying path as
24132414

24142415
static PyObject *
24152416
os_stat_impl(PyObject *module, path_t *path, int dir_fd, int follow_symlinks)
2416-
/*[clinic end generated code: output=7d4976e6f18a59c5 input=099d356c306fa24a]*/
2417+
/*[clinic end generated code: output=7d4976e6f18a59c5 input=270bd64e7bb3c8f7]*/
24172418
{
24182419
return posix_do_stat("stat", path, dir_fd, follow_symlinks);
24192420
}

0 commit comments

Comments
 (0)