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

Remove bad pipe message log #1246

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ipykernel/iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ async def _handle_pipe_msg(self, msg=None):
if not self._pipe_flag or not self._is_master_process():
return
if msg[0] != self._pipe_uuid:
print("Bad pipe message: %s", msg, file=sys.__stderr__)
# print("Bad pipe message: %s", msg, file=sys.__stderr__)
Copy link
Member

Choose a reason for hiding this comment

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

These messages do indicate a problem, and should still be logged, not entirely suppressed. The problem comes from the change that sys.__stderr__ is now duplicated and forwarded to users, when this message is meant to only. What we really want to write to is sys.stderr._original_stdstream_copy.

I see two options:

  1. when we capture the low-level __stderr__, we could replace sys.__stderr__ with the new captured fd, so statements like this do what we originally meant them to (only write to stderr, not captured and forwarded), or
  2. keep capturing __stderr__ and explicitly write to the "truly really actually only original stderr" FD for messages like these.

return
self.send_multipart(msg[1:])

Expand Down
Loading