``).
+ This method is called to handle the start tag of an element (e.g. ``
``).
The *tag* argument is the name of the tag converted to lower case. The *attrs*
argument is a list of ``(name, value)`` pairs containing the attributes found
diff --git a/Doc/library/http.cookiejar.rst b/Doc/library/http.cookiejar.rst
index 7b1aa80a01797c..3d59665be4f254 100644
--- a/Doc/library/http.cookiejar.rst
+++ b/Doc/library/http.cookiejar.rst
@@ -20,7 +20,7 @@ Both the regular Netscape cookie protocol and the protocol defined by
:rfc:`2965` are handled. RFC 2965 handling is switched off by default.
:rfc:`2109` cookies are parsed as Netscape cookies and subsequently treated
either as Netscape or RFC 2965 cookies according to the 'policy' in effect.
-Note that the great majority of cookies on the Internet are Netscape cookies.
+Note that the great majority of cookies on the internet are Netscape cookies.
:mod:`http.cookiejar` attempts to follow the de-facto Netscape cookie protocol (which
differs substantially from that set out in the original Netscape specification),
including taking note of the ``max-age`` and ``port`` cookie-attributes
@@ -122,7 +122,7 @@ The following classes are provided:
:mod:`http.cookiejar` and :mod:`http.cookies` modules do not depend on each
other.
- https://curl.haxx.se/rfc/cookie_spec.html
+ https://curl.se/rfc/cookie_spec.html
The specification of the original Netscape cookie protocol. Though this is
still the dominant protocol, the 'Netscape cookie protocol' implemented by all
the major browsers (and :mod:`http.cookiejar`) only bears a passing resemblance to
diff --git a/Doc/library/http.rst b/Doc/library/http.rst
index 1569d504c7f92a..2466c84476c6c1 100644
--- a/Doc/library/http.rst
+++ b/Doc/library/http.rst
@@ -35,7 +35,7 @@ associated messages through the :class:`http.HTTPStatus` enum:
>>> from http import HTTPStatus
>>> HTTPStatus.OK
- HTTPStatus.OK
+
>>> HTTPStatus.OK == 200
True
>>> HTTPStatus.OK.value
@@ -45,7 +45,7 @@ associated messages through the :class:`http.HTTPStatus` enum:
>>> HTTPStatus.OK.description
'Request fulfilled, document follows'
>>> list(HTTPStatus)
- [HTTPStatus.CONTINUE, HTTPStatus.SWITCHING_PROTOCOLS, ...]
+ [, , ...]
.. _http-status-codes:
diff --git a/Doc/library/http.server.rst b/Doc/library/http.server.rst
index 729d7e37137a81..0de02834401aa8 100644
--- a/Doc/library/http.server.rst
+++ b/Doc/library/http.server.rst
@@ -14,7 +14,7 @@
--------------
-This module defines classes for implementing HTTP servers (Web servers).
+This module defines classes for implementing HTTP servers.
.. warning::
@@ -197,7 +197,7 @@ provides three different variants:
request header it responds back with a ``100 Continue`` followed by ``200
OK`` headers.
This method can be overridden to raise an error if the server does not
- want the client to continue. For e.g. server can chose to send ``417
+ want the client to continue. For e.g. server can choose to send ``417
Expectation Failed`` as a response header and ``return False``.
.. versionadded:: 3.2
@@ -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()
@@ -412,17 +412,22 @@ the current directory::
.. _http-server-cli:
:mod:`http.server` can also be invoked directly using the :option:`-m`
-switch of the interpreter with a ``port number`` argument. Similar to
+switch of the interpreter. Similar to
the previous example, this serves files relative to the current directory::
- python -m http.server 8000
+ python -m http.server
+
+The server listens to port 8000 by default. The default can be overridden
+by passing the desired port number as an argument::
+
+ python -m http.server 9000
-By default, server binds itself to all interfaces. The option ``-b/--bind``
+By default, the server binds itself to all interfaces. The option ``-b/--bind``
specifies a specific address to which it should bind. Both IPv4 and IPv6
addresses are supported. For example, the following command causes the server
to bind to localhost only::
- python -m http.server 8000 --bind 127.0.0.1
+ python -m http.server --bind 127.0.0.1
.. versionadded:: 3.4
``--bind`` argument was introduced.
@@ -430,14 +435,14 @@ to bind to localhost only::
.. versionadded:: 3.8
``--bind`` argument enhanced to support IPv6
-By default, server uses the current directory. The option ``-d/--directory``
+By default, the server uses the current directory. The option ``-d/--directory``
specifies a directory to which it should serve the files. For example,
the following command uses a specific directory::
python -m http.server --directory /tmp/
.. versionadded:: 3.7
- ``--directory`` specify alternate directory
+ ``--directory`` argument was introduced.
.. class:: CGIHTTPRequestHandler(request, client_address, server)
@@ -482,4 +487,4 @@ the following command uses a specific directory::
:class:`CGIHTTPRequestHandler` can be enabled in the command line by passing
the ``--cgi`` option::
- python -m http.server --cgi 8000
+ python -m http.server --cgi
diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index 3c302115b5f408..d6021042c61166 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -96,11 +96,13 @@ Save Copy As...
Print Window
Print the current window to the default printer.
-Close
- Close the current window (ask to save if unsaved).
+Close Window
+ Close the current window (if an unsaved editor, ask to save; if an unsaved
+ Shell, ask to quit execution). Calling ``exit()`` or ``close()`` in the Shell
+ window also closes Shell. If this is the only window, also exit IDLE.
-Exit
- Close all windows and quit IDLE (ask to save unsaved windows).
+Exit IDLE
+ Close all windows and quit IDLE (ask to save unsaved edit windows).
Edit menu (Shell and Editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -518,7 +520,7 @@ and not restarting the Shell thereafter. This is especially useful
after adding imports at the top of a file. This also increases
possible attribute completions.
-Completion boxes intially exclude names beginning with '_' or, for
+Completion boxes initially exclude names beginning with '_' or, for
modules, not included in '__all__'. The hidden names can be accessed
by typing '_' after '.', either before or after the box is opened.
@@ -613,6 +615,12 @@ keywords, builtin class and function names, names following ``class`` and
``def``, strings, and comments. For any text window, these are the cursor (when
present), found text (when possible), and selected text.
+IDLE also highlights the :ref:`soft keywords