Skip to content

Commit 3de6546

Browse files
[3.13] gh-132971: Update shutil.which() docs (GH-133067) (#133804)
gh-132971: Update shutil.which() docs (GH-133067) (cherry picked from commit d13d5fd) Co-authored-by: Kokona <[email protected]>
1 parent 9718880 commit 3de6546

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/library/shutil.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,10 @@ Directory and files operations
454454
:envvar:`PATH` environment variable is read from :data:`os.environ`,
455455
falling back to :data:`os.defpath` if it is not set.
456456

457+
If *cmd* contains a directory component, :func:`!which` only checks the
458+
specified path directly and does not search the directories listed in
459+
*path* or in the system's :envvar:`PATH` environment variable.
460+
457461
On Windows, the current directory is prepended to the *path* if *mode* does
458462
not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the
459463
Windows API ``NeedCurrentDirectoryForExePathW`` will be consulted to

0 commit comments

Comments
 (0)