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

detach io thread output from creation cell #905

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

minrk
Copy link
Member

@minrk minrk commented Oct 29, 2024

ipykernel has started associating thread output with the Cell that spawned the Thread (ipython/ipykernel#1186), but that sends output to the wrong cell for cells that are meant to stream to the current output area.

there is currently no opt-out for this, so we have to delete the association after it is created

There should be a public API to disable this for specific Threads, but until then disable the private association after it is created

fixes #893

An alternative (and possibly better?) fix is to explicitly route outputs from the io thread to the main thread, but that's tricky with event loops.

@minrk
Copy link
Member Author

minrk commented Oct 29, 2024

Wait, this isn't quite right. Need to figure out if I can make a test

minrk added 2 commits October 30, 2024 10:37
use a Thread subclass that immediately undoes the output routing after it is applied
@minrk minrk force-pushed the client-thread-output branch from 51ae59f to e534ef1 Compare October 30, 2024 09:43
@minrk
Copy link
Member Author

minrk commented Oct 30, 2024

added more thorough workaround to totally disable ipykernel's wrong output routing for all threads we create. Reported need for public API (and likely different defaults) as ipython/ipykernel#1289

@minrk minrk merged commit 204d777 into ipython:main Oct 30, 2024
17 checks passed
@minrk minrk deleted the client-thread-output branch October 30, 2024 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors shown under wrong cell using magics
1 participant