The pydoc CLI assumed -m pydoc would add the empty string to sys.path, and hence got confused when it switched to adding the full initial working directory instead. This refactors the pydoc CLI path manipulation to be more testable, and ensures it won't accidentally remove the standard library directory containing pydoc itself from sys.path. (cherry picked from commit 82a9481) Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
|
@ncoghlan: Backport status check is done, and it's a success ✅ . |
|
Thanks! |
The pydoc CLI assumed -m pydoc would add the empty string
to sys.path, and hence got confused when it switched to
adding the full initial working directory instead.
This refactors the pydoc CLI path manipulation to be
more testable, and ensures it won't accidentally
remove the standard library directory containing
pydoc itself from sys.path.
(cherry picked from commit 82a9481)
Co-authored-by: Nick Coghlan ncoghlan@gmail.com
https://bugs.python.org/issue33185