Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e5d54c

Browse files
JelleZijlstrapitrou
authored andcommitted
bpo-31965: fix doc for multiprocessing.connection.Client and Listener (#4304)
* fix doc for multiprocessing.connection.Client The authenticate argument does not exist on either Client or Listener: - https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L483 (master) - https://github.com/python/cpython/blob/3.6/Lib/multiprocessing/connection.py#L478 (3.6) - https://github.com/python/cpython/blob/3.5/Lib/multiprocessing/connection.py#L478 (3.5) - https://github.com/python/cpython/blob/3.4/Lib/multiprocessing/connection.py#L487 (3.4) The documentation also claimed that these functions will call `current_process().auth_key`, for which I could find no evidence in the code. I rewrote the documentation to reflect the actual behavior. Also made some small changes to vary sentence structure.
1 parent 22b1128 commit 1e5d54c

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

Doc/library/multiprocessing.rst

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,7 +2296,7 @@ multiple connections at the same time.
22962296
If a welcome message is not received, then
22972297
:exc:`~multiprocessing.AuthenticationError` is raised.
22982298

2299-
.. function:: Client(address[, family[, authenticate[, authkey]]])
2299+
.. function:: Client(address[, family[, authkey]])
23002300

23012301
Attempt to set up a connection to the listener which is using address
23022302
*address*, returning a :class:`~multiprocessing.Connection`.
@@ -2305,14 +2305,13 @@ multiple connections at the same time.
23052305
generally be omitted since it can usually be inferred from the format of
23062306
*address*. (See :ref:`multiprocessing-address-formats`)
23072307

2308-
If *authenticate* is ``True`` or *authkey* is a byte string then digest
2309-
authentication is used. The key used for authentication will be either
2310-
*authkey* or ``current_process().authkey`` if *authkey* is ``None``.
2311-
If authentication fails then
2312-
:exc:`~multiprocessing.AuthenticationError` is raised. See
2313-
:ref:`multiprocessing-auth-keys`.
2308+
If *authkey* is given and not None, it should be a byte string and will be
2309+
used as the secret key for an HMAC-based authentication challenge. No
2310+
authentication is done if *authkey* is None.
2311+
:exc:`~multiprocessing.AuthenticationError` is raised if authentication fails.
2312+
See :ref:`multiprocessing-auth-keys`.
23142313

2315-
.. class:: Listener([address[, family[, backlog[, authenticate[, authkey]]]]])
2314+
.. class:: Listener([address[, family[, backlog[, authkey]]]])
23162315

23172316
A wrapper for a bound socket or Windows named pipe which is 'listening' for
23182317
connections.
@@ -2341,17 +2340,10 @@ multiple connections at the same time.
23412340
to the :meth:`~socket.socket.listen` method of the socket once it has been
23422341
bound.
23432342

2344-
If *authenticate* is ``True`` (``False`` by default) or *authkey* is not
2345-
``None`` then digest authentication is used.
2346-
2347-
If *authkey* is a byte string then it will be used as the
2348-
authentication key; otherwise it must be ``None``.
2349-
2350-
If *authkey* is ``None`` and *authenticate* is ``True`` then
2351-
``current_process().authkey`` is used as the authentication key. If
2352-
*authkey* is ``None`` and *authenticate* is ``False`` then no
2353-
authentication is done. If authentication fails then
2354-
:exc:`~multiprocessing.AuthenticationError` is raised.
2343+
If *authkey* is given and not None, it should be a byte string and will be
2344+
used as the secret key for an HMAC-based authentication challenge. No
2345+
authentication is done if *authkey* is None.
2346+
:exc:`~multiprocessing.AuthenticationError` is raised if authentication fails.
23552347
See :ref:`multiprocessing-auth-keys`.
23562348

23572349
.. method:: accept()

0 commit comments

Comments
 (0)