Skip to content

Catch missing DELIM in feed_identities on shell and control channels - #1581

Merged
minrk merged 1 commit into
ipython:mainfrom
vyrnsynx:fix/catch-missing-delim-in-feed-identities
Oct 26, 2026
Merged

minrk merged 1 commit into
ipython:mainfrom
vyrnsynx:fix/catch-missing-delim-in-feed-identities

Conversation

@vyrnsynx

Copy link
Copy Markdown
Contributor

Closes #1580

In Kernel.process_control, Kernel.dispatch_shell, and Kernel.shell_channel_thread_main, self.session.feed_identities(msg, copy=False) was called immediately before the try ... except Exception: block that wraps self.session.deserialize(...) (whereas Kernel.shell_main already wrapped both inside try ... except Exception:).

When a non-Jupyter connection or malformed message without the <IDS|MSG> delimiter arrives on the shell or control port, feed_identities raises ValueError: DELIM not in msg_list. Because shell_channel_thread_main and dispatch_control are registered directly as ZMQStream.on_recv callbacks in ipykernel 7, the uncaught ValueError escaped into ZMQStream._log_error (tornado.general), printing the traceback into the active notebook cell's stderr output instead of logging it to self.log.

Move feed_identities inside the existing try ... except Exception: blocks in process_control, dispatch_shell, and shell_channel_thread_main so malformed messages missing DELIM are logged via self.log.error(...) as in 6.x.

@minrk minrk added the bug label Oct 26, 2026
@minrk
minrk merged commit 1437742 into ipython:main Oct 26, 2026
38 of 39 checks passed
@minrk

minrk commented Oct 26, 2026

Copy link
Copy Markdown
Member

Thanks!

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.

ipykernel 7: non-Jupyter connection to shell/control port shows "DELIM not in msg_list" traceback in notebook output (6.x logged it to the kernel log)

2 participants