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

jupyter-run: avoid traceback for NoSuchKernel #994

Merged
merged 2 commits into from
Sep 29, 2024

Conversation

minrk
Copy link
Member

@minrk minrk commented Nov 2, 2023

NoSuchKernel used to raise during KernelManager instantiation, but it is now delayed, so our except NoSuchKernel isn't catching the error when it's raised anymore.

Access kernel_spec to ensure it's raised where it will be caught.

Also removes a redundant warning log immediately before raising, which prevents complete handling of NoSuchError and produces unavoidable duplicate logs.

Test added for runapp, both regression for #993 and simple exercise for everything working correctly.

closes #993

@minrk minrk added the bug label Nov 2, 2023
@minrk
Copy link
Member Author

minrk commented Nov 3, 2023

need to investigate why the minimum version test doesn't see any output. Hard to compare, since the test jobs don't show what packages are installed, so I can't easily diff or reproduce the envs.

@blink1073
Copy link
Contributor

The minimum tests use hatch --v run, you can add that to the standard tests to compare.

NoSuchKernel used to raise during KernelManager instantiation,
but it is now delayed.

Access kernel_spec to ensure it's raised where it will be caught.

Also removes a redundant warning log immediately before raising,
which prevents complete handling of NoSuchError and produces unavoidable duplicate logs.
ensures kernel is ready before running

avoids lost output if iopub isn't connected yet

and shutdown kernel when finished, rather than relying on the kernel shutting itself down
@minrk minrk merged commit 060fac3 into jupyter:main Sep 29, 2024
34 checks passed
@minrk minrk deleted the runapp-no-kernel branch September 29, 2024 11:39
assert "Could not find kernel" in p.stderr
assert kernel_name in p.stderr
# shouldn't show a traceback
assert "Traceback" not in p.stderr
Copy link
Contributor

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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When no kernel is found, jupter-run crashes with a traceback
3 participants