Stop using deprecated recv_multipart when using in-process socket.#762
Merged
minrk merged 1 commit intoipython:masterfrom Sep 7, 2021
Merged
Stop using deprecated recv_multipart when using in-process socket.#762minrk merged 1 commit intoipython:masterfrom
minrk merged 1 commit intoipython:masterfrom
Conversation
Member
Author
|
I believe @minrk and or @SylvainCorlay might have more experience around this area. |
Member
|
Fine with undeprecating recv_multipart, or adding a check here that does an isinstance if it's a socket itself or a BackgroundSocket. |
Member
Author
Actually while doing that I just realized that So it can only be a BackgroundSocket or subclass so the isinstance seem unnecessary and this is likely the right fix. |
Found while working on napari/napari#3314 This should be the right fix, as BackgroundSocket is used only in inprocess kernel, and while in general iopub_socket looks like it can be `Any()` for this particular class we have a trait saying iopub_socket has to be a BackgroundSocket The recv in jupyter_client side (which is called by the line I change here) is def recv(self, socket, mode=zmq.NOBLOCK, content=True, copy=True): """Receive and unpack a message. Parameters ---------- socket : ZMQStream or Socket The socket or stream to use in receiving. Returns ------- [idents], msg [idents] is a list of idents and msg is a nested message dict of same format as self.msg returns. """ if isinstance(socket, ZMQStream): socket = socket.socket try: msg_list = socket.recv_multipart(mode, copy=copy) # this will trigger deprecation warning except zmq.ZMQError as e: ... And I doubt we want to make that aware of background socket.
Member
Author
|
FOrce pushed identical commit but with above note added to the text. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while working on napari/napari#3314
I'm not too sure this is the right fix, as BackgroundSocket is used only
in inprocess kernel, and that in general io_pub socket looks like the
can be
Any()and that therefore may not have a io_thread.But if that's the case, then should we maybe un-deprecate recv_multipart on background socket ?
the recv in jupyter_client side (which is called by the line I change
here) is
And I doubt we want to make that aware of background socket.