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