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

Avoid echoing onto a captured FD #1111

Merged
merged 13 commits into from
May 10, 2023
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Apr 24, 2023

When echoing output onto stderr, it should be onto the copy, not the redirected FD, so it only goes to the terminal instead of making an infinite loop, echoing and then capturing and then re-echoing the same output.

I've verified that this works, I just need to work out the tests without messing up pytest output itself.

closes #859

ipykernel/iostream.py Outdated Show resolved Hide resolved
avoids hang if there's nothing to read

could also close first, which would wake the thread, but that gets complicated with the redirect
to avoid messing with pytest output capture

I'm pretty sure it's _possible_ to do this in-process, but I can't seem to figure it out
@garlandz-db
Copy link
Contributor

@minrk thanks for fixing this! lmk how i can help drive this to completion

@minrk minrk marked this pull request as ready for review May 8, 2023 13:07
minrk added 2 commits May 8, 2023 15:24
otherwise, we have no idea why things break
stop closes the event puller socket, but only if start was called
@minrk
Copy link
Member Author

minrk commented May 9, 2023

Finally got all actual tests to pass!

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!

@blink1073 blink1073 merged commit d63c33a into ipython:main May 10, 2023
@minrk minrk deleted the quiet-capture-echo branch June 13, 2023 13:01
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.

IPKernelApp configs capture_fd_output and quiet conflict and break ipykernel
3 participants