bpo-33185: Fix regression in pydoc CLI sys.path handling by ncoghlan · Pull Request #6419 · python/cpython

@ncoghlan

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.

serhiy-storchaka

brettcannon

serhiy-storchaka

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Apr 15, 2018
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>

miss-islington added a commit that referenced this pull request

Apr 15, 2018
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>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Apr 15, 2018
Adds some working and markup fixes that I missed
in the initial commit for this issue.

(Follow-up to pythonGH-6419)
(cherry picked from commit 1a5c4bd)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>

ncoghlan added a commit that referenced this pull request

Apr 15, 2018
Adds some working and markup fixes that I missed
in the initial commit for this issue.

(Follow-up to GH-6419)

miss-islington added a commit that referenced this pull request

Apr 15, 2018
Adds some working and markup fixes that I missed
in the initial commit for this issue.

(Follow-up to GH-6419)
(cherry picked from commit 1a5c4bd)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>