https://github.com/python/cpython/commit/fca2623c2f5e0dc14533caa7f63ce4aa1508451c
commit: fca2623c2f5e0dc14533caa7f63ce4aa1508451c
branch: 3.12
author: Tom Most <[email protected]>
committer: AA-Turner <[email protected]>
date: 2024-09-26T08:56:30+01:00
summary:

[3.12] Doc: Improve documentation for the ``path`` argument in 
``shutil.which()`` (GH-124494) (#124576)

files:
M Doc/library/shutil.rst

diff --git a/Doc/library/shutil.rst b/Doc/library/shutil.rst
index 49d2c7ffe0cd69..028778d56518f8 100644
--- a/Doc/library/shutil.rst
+++ b/Doc/library/shutil.rst
@@ -439,8 +439,10 @@ Directory and files operations
    *mode* is a permission mask passed to :func:`os.access`, by default
    determining if the file exists and is executable.
 
-   When no *path* is specified, the results of :func:`os.environ` are used,
-   returning either the "PATH" value or a fallback of :data:`os.defpath`.
+   *path* is a "``PATH`` string" specifying the directories to look in,
+   delimited by :data:`os.pathsep`. When no *path* is specified, the
+   :envvar:`PATH` environment variable is read from :data:`os.environ`,
+   falling back to :data:`os.defpath` if it is not set.
 
    On Windows, the current directory is prepended to the *path* if *mode* does
    not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the
@@ -449,9 +451,9 @@ Directory and files operations
    consulting the current working directory for executables: set the 
environment
    variable ``NoDefaultCurrentDirectoryInExePath``.
 
-   Also on Windows, the ``PATHEXT`` variable is used to resolve commands
-   that may not already include an extension. For example, if you call
-   ``shutil.which("python")``, :func:`which` will search ``PATHEXT``
+   Also on Windows, the :envvar:`PATHEXT` environment variable is used to
+   resolve commands that may not already include an extension. For example,
+   if you call ``shutil.which("python")``, :func:`which` will search 
``PATHEXT``
    to know that it should look for ``python.exe`` within the *path*
    directories. For example, on Windows::
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to