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

Skip to content

Commit 77892dc

Browse files
committed
More doc fixes: made it clear where to start reading when you click on <dir_fd>.
1 parent 68d34f4 commit 77892dc

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

Doc/library/os.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,8 @@ features:
12021202

12031203
.. _path_fd:
12041204

1205-
* For some functions, the *path* argument can be not only a string giving a path
1205+
* **specifying a file descriptor:**
1206+
For some functions, the *path* argument can be not only a string giving a path
12061207
name, but also a file descriptor. The function will then operate on the file
12071208
referred to by the descriptor. (For POSIX systems, Python will call the
12081209
``f...`` version of the function.)
@@ -1216,19 +1217,19 @@ features:
12161217

12171218
.. _dir_fd:
12181219

1219-
* For functions with a *dir_fd* parameter: If *dir_fd* is not ``None``, it
1220+
* **paths relative to directory descriptors:** If *dir_fd* is not ``None``, it
12201221
should be a file descriptor referring to a directory, and the path to operate
12211222
on should be relative; path will then be relative to that directory. If the
12221223
path is absolute, *dir_fd* is ignored. (For POSIX systems, Python will call
1223-
the ``...at`` version of the function.)
1224+
the ``...at`` or ``f...at`` version of the function.)
12241225

12251226
You can check whether or not *dir_fd* is supported on your platform using
12261227
:data:`os.supports_dir_fd`. If it is unavailable, using it will raise a
12271228
:exc:`NotImplementedError`.
12281229

12291230
.. _follow_symlinks:
12301231

1231-
* For functions ith a *follow_symlinks* parameter: If *follow_symlinks* is
1232+
* **not following symlinks:** If *follow_symlinks* is
12321233
``False``, and the last element of the path to operate on is a symbolic link,
12331234
the function will operate on the symbolic link itself instead of the file the
12341235
link points to. (For POSIX systems, Python will call the ``l...`` version of
@@ -1311,7 +1312,7 @@ features:
13111312

13121313
Change the current working directory to *path*.
13131314

1314-
This function can support :ref:`working on a file descriptor <path_fd>`. The
1315+
This function can support :ref:`specifying a file descriptor <path_fd>`. The
13151316
descriptor must refer to an opened directory, not an open file.
13161317

13171318
Availability: Unix, Windows.
@@ -1494,8 +1495,8 @@ features:
14941495
This function can be called with a bytes or string argument, and returns
14951496
filenames of the same datatype.
14961497

1497-
This function can also support :ref:`specifying an open file descriptor
1498-
<path_fd>` (referring to a directory).
1498+
This function can also support :ref:`specifying a file descriptor
1499+
<path_fd>`; the file descriptor must refer to a directory.
14991500

15001501
Availability: Unix, Windows.
15011502

@@ -1639,7 +1640,7 @@ features:
16391640
included in ``pathconf_names``, an :exc:`OSError` is raised with
16401641
:const:`errno.EINVAL` for the error number.
16411642

1642-
This function can support :ref:`specifying an open file descriptor
1643+
This function can support :ref:`specifying a file descriptor
16431644
<path_fd>`.
16441645

16451646
Availability: Unix.
@@ -1851,7 +1852,7 @@ features:
18511852
:attr:`st_mtime`, :attr:`st_ctime`. More items may be added at the end by
18521853
some implementations.
18531854

1854-
This function can support :ref:`specifying an open file descriptor
1855+
This function can support :ref:`specifying a file descriptor
18551856
<path_fd>`, :ref:`specifying a file descriptor <path_fd>` and :ref:`not
18561857
following symlinks <follow_symlinks>`.
18571858

0 commit comments

Comments
 (0)