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

Add IPKernelApp.capture_fd_output config to disable FD-level capture #752

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

minrk
Copy link
Member

@minrk minrk commented Aug 26, 2021

This adds a process-level flag to opt out of this behavior, if folks want to restore the previous behavior.

It might be nice to expose an API to turn this off/on on a context basis, wether it's on by default or not. That would give folks a better way to manage output capture based on library behavior.

closes #737

wurlitzer is a tool that implements the same functionality as a context manager, if that's helpful. There are lots of edge cases involving flushes, etc. I dealt with over there. It also defines an IPython extension.

Be aware that doing this can cause hangs if GIL-holding code tries to write more than pipe-max-size bytes (usually 64k by default). Running this code will hang most IPython kernels in a non-interruptible state after #630:

import ctypes
ctypes.PyDLL(None).printf(b'1' * 100_000)

see more info minrk/wurlitzer#48

allows opting out of the new behavior, if so desired
@blink1073 blink1073 added this to the 6.3 milestone Aug 26, 2021
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.

Thank you!

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

Successfully merging this pull request may close these issues.

New output redirection in ipykernel 6.0 clutters notebooks
2 participants