From e9b96cdd72589a4e70f9e0b5f4baa23fed85a575 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 25 May 2026 16:27:36 +0100 Subject: [PATCH 1/2] Add a secuirty warning to `pydoc` --- Doc/library/pydoc.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index f236eba8457657..516650d2a401fa 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -17,6 +17,11 @@ The :mod:`!pydoc` module automatically generates documentation from Python modules. The documentation can be presented as pages of text on the console, served to a web browser, or saved to HTML files. +.. warning:: + + The :mod:`!pydoc` HTTP server is intended for local use during + development and is not suitable for production use. + For modules, classes, functions and methods, the displayed documentation is derived from the docstring (i.e. the :attr:`~definition.__doc__` attribute) of the object, and recursively of its documentable members. If there is no docstring, From e900b15546ca12781782f6771d689f9cd46fb100 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Mon, 25 May 2026 18:26:06 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Move=20warning=20as=20per=20B=C3=A9n=C3=A9d?= =?UTF-8?q?ikt's=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doc/library/pydoc.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/pydoc.rst b/Doc/library/pydoc.rst index 516650d2a401fa..a0cfb440a36ffa 100644 --- a/Doc/library/pydoc.rst +++ b/Doc/library/pydoc.rst @@ -17,11 +17,6 @@ The :mod:`!pydoc` module automatically generates documentation from Python modules. The documentation can be presented as pages of text on the console, served to a web browser, or saved to HTML files. -.. warning:: - - The :mod:`!pydoc` HTTP server is intended for local use during - development and is not suitable for production use. - For modules, classes, functions and methods, the displayed documentation is derived from the docstring (i.e. the :attr:`~definition.__doc__` attribute) of the object, and recursively of its documentable members. If there is no docstring, @@ -73,6 +68,11 @@ 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. +.. warning:: + + The :mod:`!pydoc` HTTP server is intended for local use during + development and is not suitable for production use. + :program:`python -m pydoc -n ` 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