Skip to content

Commit 9a039d5

Browse files
bpo-32362: Fix references to non-existent multiprocessing.Connection() (GH-6223)
(cherry picked from commit 9f3535c) Co-authored-by: Bo Bayles <bbayles@gmail.com>
1 parent ef91552 commit 9a039d5

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

Doc/library/multiprocessing.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,9 @@ For an example of the usage of queues for interprocess communication see
719719

720720
.. function:: Pipe([duplex])
721721

722-
Returns a pair ``(conn1, conn2)`` of :class:`Connection` objects representing
723-
the ends of a pipe.
722+
Returns a pair ``(conn1, conn2)`` of
723+
:class:`~multiprocessing.connection.Connection` objects representing the
724+
ends of a pipe.
724725

725726
If *duplex* is ``True`` (the default) then the pipe is bidirectional. If
726727
*duplex* is ``False`` then the pipe is unidirectional: ``conn1`` can only be
@@ -1005,10 +1006,13 @@ Miscellaneous
10051006
Connection Objects
10061007
~~~~~~~~~~~~~~~~~~
10071008

1009+
.. currentmodule:: multiprocessing.connection
1010+
10081011
Connection objects allow the sending and receiving of picklable objects or
10091012
strings. They can be thought of as message oriented connected sockets.
10101013

1011-
Connection objects are usually created using :func:`Pipe` -- see also
1014+
Connection objects are usually created using
1015+
:func:`Pipe <multiprocessing.Pipe>` -- see also
10121016
:ref:`multiprocessing-listeners-clients`.
10131017

10141018
.. class:: Connection
@@ -1143,6 +1147,8 @@ For example:
11431147
Synchronization primitives
11441148
~~~~~~~~~~~~~~~~~~~~~~~~~~
11451149

1150+
.. currentmodule:: multiprocessing
1151+
11461152
Generally synchronization primitives are not as necessary in a multiprocess
11471153
program as they are in a multithreaded program. See the documentation for
11481154
:mod:`threading` module.
@@ -2253,7 +2259,7 @@ Listeners and Clients
22532259
:synopsis: API for dealing with sockets.
22542260

22552261
Usually message passing between processes is done using queues or by using
2256-
:class:`~multiprocessing.Connection` objects returned by
2262+
:class:`~Connection` objects returned by
22572263
:func:`~multiprocessing.Pipe`.
22582264

22592265
However, the :mod:`multiprocessing.connection` module allows some extra
@@ -2283,7 +2289,7 @@ multiple connections at the same time.
22832289
.. function:: Client(address[, family[, authkey]])
22842290

22852291
Attempt to set up a connection to the listener which is using address
2286-
*address*, returning a :class:`~multiprocessing.Connection`.
2292+
*address*, returning a :class:`~Connection`.
22872293

22882294
The type of the connection is determined by *family* argument, but this can
22892295
generally be omitted since it can usually be inferred from the format of
@@ -2333,8 +2339,8 @@ multiple connections at the same time.
23332339
.. method:: accept()
23342340

23352341
Accept a connection on the bound socket or named pipe of the listener
2336-
object and return a :class:`~multiprocessing.Connection` object. If
2337-
authentication is attempted and fails, then
2342+
object and return a :class:`~Connection` object.
2343+
If authentication is attempted and fails, then
23382344
:exc:`~multiprocessing.AuthenticationError` is raised.
23392345

23402346
.. method:: close()
@@ -2370,7 +2376,7 @@ multiple connections at the same time.
23702376
For both Unix and Windows, an object can appear in *object_list* if
23712377
it is
23722378

2373-
* a readable :class:`~multiprocessing.Connection` object;
2379+
* a readable :class:`~multiprocessing.connection.Connection` object;
23742380
* a connected and readable :class:`socket.socket` object; or
23752381
* the :attr:`~multiprocessing.Process.sentinel` attribute of a
23762382
:class:`~multiprocessing.Process` object.
@@ -2493,10 +2499,10 @@ an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
24932499
Authentication keys
24942500
~~~~~~~~~~~~~~~~~~~
24952501

2496-
When one uses :meth:`Connection.recv <multiprocessing.Connection.recv>`, the
2502+
When one uses :meth:`Connection.recv <Connection.recv>`, the
24972503
data received is automatically
2498-
unpickled. Unfortunately unpickling data from an untrusted source is a security
2499-
risk. Therefore :class:`Listener` and :func:`Client` use the :mod:`hmac` module
2504+
unpickled. Unfortunately unpickling data from an untrusted source is a security
2505+
risk. Therefore :class:`Listener` and :func:`Client` use the :mod:`hmac` module
25002506
to provide digest authentication.
25012507

25022508
An authentication key is a byte string which can be thought of as a

0 commit comments

Comments
 (0)