Skip to content

Commit 3fc1cb2

Browse files
committed
[2.7] bpo-32362: Fix references to non-existent multiprocessing.Connection() (pythonGH-6223).
(cherry picked from commit 9f3535c) Co-authored-by: Bo Bayles <bbayles@gmail.com>
1 parent 0b3800d commit 3fc1cb2

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Doc/library/multiprocessing.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,9 @@ For an example of the usage of queues for interprocess communication see
574574

575575
.. function:: Pipe([duplex])
576576

577-
Returns a pair ``(conn1, conn2)`` of :class:`Connection` objects representing
578-
the ends of a pipe.
577+
Returns a pair ``(conn1, conn2)`` of
578+
:class:`~multiprocessing.connection.Connection` objects representing the
579+
ends of a pipe.
579580

580581
If *duplex* is ``True`` (the default) then the pipe is bidirectional. If
581582
*duplex* is ``False`` then the pipe is unidirectional: ``conn1`` can only be
@@ -803,10 +804,13 @@ Miscellaneous
803804
Connection Objects
804805
~~~~~~~~~~~~~~~~~~
805806

807+
.. currentmodule:: multiprocessing.connection
808+
806809
Connection objects allow the sending and receiving of picklable objects or
807810
strings. They can be thought of as message oriented connected sockets.
808811

809-
Connection objects are usually created using :func:`Pipe` -- see also
812+
Connection objects are usually created using
813+
:func:`Pipe <multiprocessing.Pipe>` -- see also
810814
:ref:`multiprocessing-listeners-clients`.
811815

812816
.. class:: Connection
@@ -926,6 +930,8 @@ For example:
926930
Synchronization primitives
927931
~~~~~~~~~~~~~~~~~~~~~~~~~~
928932

933+
.. currentmodule:: multiprocessing
934+
929935
Generally synchronization primitives are not as necessary in a multiprocess
930936
program as they are in a multithreaded program. See the documentation for
931937
:mod:`threading` module.
@@ -1943,7 +1949,7 @@ Listeners and Clients
19431949
:synopsis: API for dealing with sockets.
19441950

19451951
Usually message passing between processes is done using queues or by using
1946-
:class:`~multiprocessing.Connection` objects returned by
1952+
:class:`~Connection` objects returned by
19471953
:func:`~multiprocessing.Pipe`.
19481954

19491955
However, the :mod:`multiprocessing.connection` module allows some extra
@@ -1972,7 +1978,7 @@ authentication* using the :mod:`hmac` module.
19721978
.. function:: Client(address[, family[, authenticate[, authkey]]])
19731979

19741980
Attempt to set up a connection to the listener which is using address
1975-
*address*, returning a :class:`~multiprocessing.Connection`.
1981+
*address*, returning a :class:`~Connection`.
19761982

19771983
The type of the connection is determined by *family* argument, but this can
19781984
generally be omitted since it can usually be inferred from the format of
@@ -2028,8 +2034,8 @@ authentication* using the :mod:`hmac` module.
20282034
.. method:: accept()
20292035

20302036
Accept a connection on the bound socket or named pipe of the listener
2031-
object and return a :class:`~multiprocessing.Connection` object. If
2032-
authentication is attempted and fails, then
2037+
object and return a :class:`~Connection` object.
2038+
If authentication is attempted and fails, then
20332039
:exc:`~multiprocessing.AuthenticationError` is raised.
20342040

20352041
.. method:: close()
@@ -2126,10 +2132,10 @@ an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
21262132
Authentication keys
21272133
~~~~~~~~~~~~~~~~~~~
21282134

2129-
When one uses :meth:`Connection.recv <multiprocessing.Connection.recv>`, the
2135+
When one uses :meth:`Connection.recv <Connection.recv>`, the
21302136
data received is automatically
2131-
unpickled. Unfortunately unpickling data from an untrusted source is a security
2132-
risk. Therefore :class:`Listener` and :func:`Client` use the :mod:`hmac` module
2137+
unpickled. Unfortunately unpickling data from an untrusted source is a security
2138+
risk. Therefore :class:`Listener` and :func:`Client` use the :mod:`hmac` module
21332139
to provide digest authentication.
21342140

21352141
An authentication key is a string which can be thought of as a password: once a

0 commit comments

Comments
 (0)