Skip to content

Commit d1b8157

Browse files
authored
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.
1 parent c019013 commit d1b8157

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Doc/library/http.server.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -320,9 +320,16 @@ provides three different variants:
320320

321321
.. class:: SimpleHTTPRequestHandler(request, client_address, server, directory=None)
322322

323-
This class serves files from the current directory and below, directly
323+
This class serves files from the directory *directory* and below,
324+
or the current directory if *directory* is not provided, directly
324325
mapping the directory structure to HTTP requests.
325326

327+
.. versionadded:: 3.7
328+
The *directory* parameter.
329+
330+
.. versionchanged:: 3.9
331+
The *directory* parameter accepts a :term:`path-like object`.
332+
326333
A lot of the work, such as parsing the request, is done by the base class
327334
:class:`BaseHTTPRequestHandler`. This class implements the :func:`do_GET`
328335
and :func:`do_HEAD` functions.
@@ -345,13 +352,6 @@ provides three different variants:
345352
This dictionary is no longer filled with the default system mappings,
346353
but only contains overrides.
347354

348-
.. attribute:: directory
349-
350-
If not specified, the directory to serve is the current working directory.
351-
352-
.. versionchanged:: 3.9
353-
Accepts a :term:`path-like object`.
354-
355355
The :class:`SimpleHTTPRequestHandler` class defines the following methods:
356356

357357
.. method:: do_HEAD()

0 commit comments

Comments
 (0)