Skip to content

[3.7] bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)#6476

Merged
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-82a9481-3.7
Apr 15, 2018
Merged

[3.7] bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)#6476
miss-islington merged 1 commit into
python:3.7from
miss-islington:backport-82a9481-3.7

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented 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

https://bugs.python.org/issue33185

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
Copy link
Copy Markdown
Contributor Author

@ncoghlan: Backport status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit d7ffa58 into python:3.7 Apr 15, 2018
@miss-islington
Copy link
Copy Markdown
Contributor Author

Thanks!

@miss-islington miss-islington deleted the backport-82a9481-3.7 branch April 15, 2018 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants