]> granicus.if.org Git - python/commit
bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 15 Apr 2018 11:52:57 +0000 (21:52 +1000)
committerGitHub <noreply@github.com>
Sun, 15 Apr 2018 11:52:57 +0000 (21:52 +1000)
commit82a948105920100ca2ec5c2340bc3890adcfe778
treeb6ed9b9402c0e83386082933015b706e58db40d7
parent480ab05d5fee2b8fa161f799af33086a4e68c7dd
bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)

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.
Doc/whatsnew/3.7.rst
Lib/pydoc.py
Lib/test/test_pydoc.py
Misc/NEWS.d/next/Library/2018-04-08-22-54-07.bpo-33185.Id-Ba9.rst [new file with mode: 0644]