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

Skip to content

[2.7] bpo-32362: Fix references to non-existent multiprocessing.Connection() (GH-6223) #6646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 5, 2018

Conversation

bbayles
Copy link
Contributor

@bbayles bbayles commented Apr 29, 2018

This PR is a backport of #6223 to 2.7.

While fixing the conflict, I noticed a mistake in the 2.7 docs. This section states there are "two" exceptions, but then goes on to define only one. I will make a separate PR for that.

CC: @serhiy-storchaka

https://bugs.python.org/issue32362

…ction() (pythonGH-6223).

(cherry picked from commit 9f3535c)

Co-authored-by: Bo Bayles <[email protected]>
@serhiy-storchaka
Copy link
Member

Thank you for your backport @bbayles. But things are more complex in 2.7. multiprocessing.Connection is not existing as well as multiprocessing.connection.Connection.

@bbayles
Copy link
Contributor Author

bbayles commented Apr 30, 2018

Ah, you are quite right. I see now how the Python 3 docs got to be the way they are.

_multiprocessing.Connection does exist, but I suspect it's not useful to document that.

I think the simplest change would be to change the reference to multiprocessing.Connection here:
image

to simply Connection?

@bbayles
Copy link
Contributor Author

bbayles commented May 1, 2018

I think I've done that by un-setting the currentmodule. The links seem to work right when I build the docs locally.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what is the bests solution here. Removing the multiprocessing. looks like an improvement.

Returns a pair ``(conn1, conn2)`` of :class:`Connection` objects representing
the ends of a pipe.
Returns a pair ``(conn1, conn2)`` of :class:`Connection` objects
representing the ends of a pipe.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded change.

@@ -1943,7 +1948,7 @@ Listeners and Clients
:synopsis: API for dealing with sockets.

Usually message passing between processes is done using queues or by using
:class:`~multiprocessing.Connection` objects returned by
:class:`~Connection` objects returned by
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ is not needed.

@@ -2139,10 +2144,10 @@ an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
Authentication keys
~~~~~~~~~~~~~~~~~~~

When one uses :meth:`Connection.recv <multiprocessing.Connection.recv>`, the
When one uses :meth:`Connection.recv <Connection.recv>`, the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just :meth:`Connection.recv`.

data received is automatically
unpickled. Unfortunately unpickling data from an untrusted source is a security
risk. Therefore :class:`Listener` and :func:`Client` use the :mod:`hmac` module
unpickled. Unfortunately unpickling data from an untrusted source is a security
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unneeded (and unwanted) changes.

Connection objects allow the sending and receiving of picklable objects or
strings. They can be thought of as message oriented connected sockets.

Connection objects are usually created using :func:`Pipe` -- see also
Connection objects are usually created using
:func:`Pipe <multiprocessing.Pipe>` -- see also
:ref:`multiprocessing-listeners-clients`.

.. class:: Connection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the :noindex: option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this breaks the links, e.g. here:


image


I doubt that's desirable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I wanted just exclude it from the index, but seems this doesn't work this way.

@bbayles
Copy link
Contributor Author

bbayles commented May 1, 2018

OK, thanks. I've changed those things.

@bbayles
Copy link
Contributor Author

bbayles commented May 1, 2018

Er, it seems I pushed the wrong thing - apologies.

Connection objects allow the sending and receiving of picklable objects or
strings. They can be thought of as message oriented connected sockets.

Connection objects are usually created using :func:`Pipe` -- see also
Connection objects are usually created using
:func:`Pipe <multiprocessing.Pipe>` -- see also
:ref:`multiprocessing-listeners-clients`.

.. class:: Connection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I wanted just exclude it from the index, but seems this doesn't work this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants