Skip to content

bpo-31294: Fix ZeroMQSocketListener and ZeroMQSocketHandler examples #3229

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 3 commits into from
Sep 7, 2017

Conversation

pablogsal
Copy link
Member

@pablogsal pablogsal commented Aug 28, 2017

This PR fixes two documentation issues regarding the ZeroMQSocketListener and ZeroMQSocketHandler examples in the Logging Cookbook:

  • The first issue is that in the __ init__ method for the ZeroMQSocketListener the base class __ init__ is never called and therefore the internal variables are not correctly initialized. This leads to an empty handlers attribute and a undefined queue attribute.

  • The second issue is that zmq.Socket.send and zmq.Socket.setsockopt only admits bytecode variables and therefore it fails in Python3 when using plain strings. The fix is to use zmq.Socket.send_stringand mq.Socket.setsockopt_string instead.

https://bugs.python.org/issue31294

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

Thanks again to your contribution and we look forward to looking at it!

@pablogsal pablogsal changed the title Fix ZeroMQSocketListener and ZeroMQSocketHandler examples bpo-31294 Fix ZeroMQSocketListener and ZeroMQSocketHandler examples Aug 28, 2017
@pablogsal pablogsal changed the title bpo-31294 Fix ZeroMQSocketListener and ZeroMQSocketHandler examples bpo-31294: Fix ZeroMQSocketListener and ZeroMQSocketHandler examples Aug 28, 2017
Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, @pablogsal

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I didn't expect the Spanish Inquisition!. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@pablogsal
Copy link
Member Author

I didn't expect the Spanish Inquisition!

@bedevere-bot
Copy link

Nobody expects the Spanish Inquisition!

@tiran: please review the changes made to this pull request.

Copy link
Member

@tiran tiran left a comment

Choose a reason for hiding this comment

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

Thanks, good work 🥇

@tiran tiran added needs backport to 3.6 docs Documentation in the Doc dir labels Sep 7, 2017
@tiran tiran merged commit 586c050 into python:master Sep 7, 2017
@miss-islington
Copy link
Contributor

🐍🍒⛏🤖 Thanks @pablogsal for the PR, and @tiran for merging it 🌮🎉.I'm working now to backport this PR to: 3.6.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 7, 2017
…mples (pythonGH-3229)

* Fix ZeroMQSocketListener and ZeroMQSocketHandler examples

* Use send_json and recv_json to simplify pyzmq interfacing

* Add News entry
(cherry picked from commit 586c050)
@bedevere-bot
Copy link

GH-3430 is a backport of this pull request to the 3.6 branch.

tiran pushed a commit that referenced this pull request Sep 7, 2017
…mples (GH-3229) (#3430)

* Fix ZeroMQSocketListener and ZeroMQSocketHandler examples

* Use send_json and recv_json to simplify pyzmq interfacing

* Add News entry
(cherry picked from commit 586c050)
@pablogsal pablogsal deleted the fix-ZeroMQSocketListener branch September 7, 2017 22:35
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants