@@ -439,8 +439,10 @@ Directory and files operations
439
439
*mode * is a permission mask passed to :func: `os.access `, by default
440
440
determining if the file exists and is executable.
441
441
442
- When no *path * is specified, the results of :func: `os.environ ` are used,
443
- returning either the "PATH" value or a fallback of :data: `os.defpath `.
442
+ *path * is a "``PATH `` string" specifying the directories to look in,
443
+ delimited by :data: `os.pathsep `. When no *path * is specified, the
444
+ :envvar: `PATH ` environment variable is read from :data: `os.environ `,
445
+ falling back to :data: `os.defpath ` if it is not set.
444
446
445
447
On Windows, the current directory is prepended to the *path * if *mode * does
446
448
not include ``os.X_OK ``. When the *mode * does include ``os.X_OK ``, the
@@ -449,9 +451,9 @@ Directory and files operations
449
451
consulting the current working directory for executables: set the environment
450
452
variable ``NoDefaultCurrentDirectoryInExePath ``.
451
453
452
- Also on Windows, the `` PATHEXT `` variable is used to resolve commands
453
- that may not already include an extension. For example, if you call
454
- ``shutil.which("python") ``, :func: `which ` will search ``PATHEXT ``
454
+ Also on Windows, the :envvar: ` PATHEXT ` environment variable is used to
455
+ resolve commands that may not already include an extension. For example,
456
+ if you call ``shutil.which("python") ``, :func: `which ` will search ``PATHEXT ``
455
457
to know that it should look for ``python.exe `` within the *path *
456
458
directories. For example, on Windows::
457
459
0 commit comments