diff options
author | Feanil Patel <feanil@edx.org> | 2017-09-14 21:54:09 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@users.noreply.github.com> | 2017-09-14 21:54:09 (GMT) |
commit | 6a396c9807b1674a24e240731f18e20de97117a5 (patch) | |
tree | 4c91775a0ed65e0d12e13f3a90e01cfdac639e98 /Doc/library | |
parent | ccb3c7654cc3d031fb93bf443a6ef9cfb11f6b43 (diff) | |
download | cpython-6a396c9807b1674a24e240731f18e20de97117a5.zip cpython-6a396c9807b1674a24e240731f18e20de97117a5.tar.gz cpython-6a396c9807b1674a24e240731f18e20de97117a5.tar.bz2 |
bpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011)
New -n flag allow overriding localhost with custom value,
for example to run from containers.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/pydoc.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index f1bfab9..f956b9d 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -70,6 +70,12 @@ will start a HTTP server on port 1234, allowing you to browse the documentation at ``http://localhost:1234/`` in your preferred Web browser. Specifying ``0`` as the port number will select an arbitrary unused port. +:program:`pydoc -n <hostname>` will start the server listening at the given +hostname. By default the hostname is 'localhost' but if you want the server to +be reached from other machines, you may want to change the host name that the +server responds to. During development this is especially useful if you want +to run pydoc from within a container. + :program:`pydoc -b` will start the server and additionally open a web browser to a module index page. Each served page has a navigation bar at the top where you can *Get* help on an individual item, *Search* all modules with a @@ -98,3 +104,6 @@ Reference Manual pages. :mod:`pydoc` now uses :func:`inspect.signature` rather than :func:`inspect.getfullargspec` to extract signature information from callables. + +.. versionchanged:: 3.7 + Added the ``-n`` option. |