Skip to content

Commit dcaad1b

Browse files
committed
Fix PYTHONPATH man page in empty-value case
Follow-up to issue 16309: <https://bugs.python.org/issue16309> (Note that the first message in that issue is slightly mistaken, as described in msg186700.) Test Plan: In a temporary directory, run: mkdir x && echo 'import z' >x/x.py && echo 'print("z")' >z.py && printf '%s\n' '#!/bin/sh' 'z' >x/x && printf '%s\n' '#!/bin/sh' 'echo "in z"' >z && chmod +x x/x && chmod +x z && : Then observe that `PYTHONPATH= python3.7 x/x.py` fails with a `ModuleNotFoundError`, but `PATH= x/x` successfully prints “in z”. Thus, the `PATH` and `PYTHONPATH` semantics are different. wchargin-branch: pythonpath-man-posix-divergence
1 parent 815061c commit dcaad1b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Misc/python.man

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ specifying \fB\-O\fP multiple times.
623623
Augments the default search path for module files.
624624
The format is the same as the shell's $PATH: one or more directory
625625
pathnames separated by colons.
626+
Unlike POSIX $PATH, an unset or empty value will not add the current
627+
working directory to the search path.
626628
Non-existent directories are silently ignored.
627629
The default search path is installation dependent, but generally
628630
begins with ${prefix}/lib/python<version> (see PYTHONHOME above).

0 commit comments

Comments
 (0)