Skip to content
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

Make Qtconsole work with PyZMQ 25 #914

Merged
merged 4 commits into from
Jan 12, 2023

Conversation

ccordoba12
Copy link
Contributor

  • It seems PyZMQ streams return now a list of bytes and not a future, so this was not handled properly.
  • This doesn't seem necessary on the main branch.

It seems PyZMQ returns now a list of bytes and not a future, so this was
not handled properly.
@ccordoba12
Copy link
Contributor Author

I'm also seeing this warning printed in the terminal when Qtconsole starts:

/home/carlos/Projects/jupyter_client/jupyter_client/threaded.py:73: RuntimeWarning: ZMQStream only supports the base zmq.Socket class.

                Use zmq.Socket(shadow=other_socket)
                or `ctx.socket(zmq.DEALER, socket_class=zmq.Socket)`
                to create a base zmq.Socket object,
                no matter what other kind of socket your Context creates.
                
  self.stream = zmqstream.ZMQStream(self.socket, self.ioloop)

but I don't know how to fix it.

@ccordoba12
Copy link
Contributor Author

ccordoba12 commented Jan 12, 2023

Ok, I think this requires to merge first #482 to make the tests pass. Pinging @blink1073 and @minrk about it.

@blink1073 blink1073 added the bug label Jan 12, 2023
Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

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

Thanks!

@ccordoba12
Copy link
Contributor Author

Thanks @blink1073 for your help with this! It seems the ipykernel failure is caused by the new Qt eventloop integration, but I don't know how to fix it.

@blink1073 blink1073 merged commit 2ee33ce into jupyter:7.x Jan 12, 2023
@ccordoba12 ccordoba12 deleted the fix-qtconsole-with-pyzmq-25 branch January 12, 2023 20:10
@minrk
Copy link
Member

minrk commented Jan 13, 2023

For tracking, the change is zeromq/pyzmq#1785 which 'fixes' ZMQStream compatibility with async sockets (with a warning, because passing an async socket to ZMQStream indicates an odd mixture of async/sync APIs).

ZMQStream never supported wrapping async sockets before pyzmq 25, but instead of raising it would fire callbacks with the wrong type (usually a Future instead of the message). Now, the on_recv callback will get the same arguments, no matter what socket class it's been called with.

The general fix that will work on all pyzmq versions is to ensure that ZMQStream is passed a regular zmq socket, which I believe was done in #835.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants