summaryrefslogtreecommitdiffstats
path: root/Doc/library/http.server.rst
diff options
context:
space:
mode:
authorJulien Palard <julien@palard.fr>2021-05-11 01:26:53 (GMT)
committerGitHub <noreply@github.com>2021-05-11 01:26:53 (GMT)
commitd1b81574edd75e33ae85c525ac988ce772675a07 (patch)
tree50a36454444594337e1b0e3457fba57f1f3340c9 /Doc/library/http.server.rst
parentc0190137ca67014008c92f04926f0cdf22db84b3 (diff)
downloadcpython-d1b81574edd75e33ae85c525ac988ce772675a07.zip
cpython-d1b81574edd75e33ae85c525ac988ce772675a07.tar.gz
cpython-d1b81574edd75e33ae85c525ac988ce772675a07.tar.bz2
Doc: http.server: directory is not a class attribute, but an argument. (GH-26017)
* Doc: http.server: directory is not a class attribute, but an argument.
Diffstat (limited to 'Doc/library/http.server.rst')
-rw-r--r--Doc/library/http.server.rst16
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index 729d7e3..029e9ec 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -320,9 +320,16 @@ provides three different variants:
.. class:: SimpleHTTPRequestHandler(request, client_address, server, directory=None)
- This class serves files from the current directory and below, directly
+ This class serves files from the directory *directory* and below,
+ or the current directory if *directory* is not provided, directly
mapping the directory structure to HTTP requests.
+ .. versionadded:: 3.7
+ The *directory* parameter.
+
+ .. versionchanged:: 3.9
+ The *directory* parameter accepts a :term:`path-like object`.
+
A lot of the work, such as parsing the request, is done by the base class
:class:`BaseHTTPRequestHandler`. This class implements the :func:`do_GET`
and :func:`do_HEAD` functions.
@@ -345,13 +352,6 @@ provides three different variants:
This dictionary is no longer filled with the default system mappings,
but only contains overrides.
- .. attribute:: directory
-
- If not specified, the directory to serve is the current working directory.
-
- .. versionchanged:: 3.9
- Accepts a :term:`path-like object`.
-
The :class:`SimpleHTTPRequestHandler` class defines the following methods:
.. method:: do_HEAD()