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

PR: Handle case when kernel fault file doesn't exist and show error with info explaining that no connection was possible (IPython Console) #22628

Merged
merged 3 commits into from
Oct 19, 2024

Conversation

dalthviz
Copy link
Member

@dalthviz dalthviz commented Oct 3, 2024

Description of Changes

Seems like passing a .json file that doesn't correspond to a kernel connection file (like for example a .json that corresponds to a notebook server instance connection file) can cause the kernel fault file to not be initialized causing and error when trying to compute a message to show to the user. Also, add an error message to prevent keep showing the Connecting to kernel over the console infowidget when no connection was possible.

A preview:

connection_file_fault_file

Issue(s) Resolved

Fixes #22448

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

… show error with info explainig no connection was possible
@ccordoba12
Copy link
Member

ccordoba12 commented Oct 3, 2024

A couple of questions for @dalthviz:

  • Connecting to external kernels is working as expected, right?
  • What if instead of your approach, we parse the json file in the dialog, detect if it's valid and if not show a warning inside the dialog? I think that would make things simpler for users, but what do you think?

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

On second thought, I think this is fine for a bugfix release @dalthviz.

I'm only leaving you a suggestion for the text you added.

spyder/plugins/ipythonconsole/widgets/shell.py Outdated Show resolved Hide resolved
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
@dalthviz
Copy link
Member Author

Connecting to external kernels is working as expected, right?

From what I tested it seems like yes 👍

What if instead of your approach, we parse the json file in the dialog, detect if it's valid and if not show a warning inside the dialog? I think that would make things simpler for users, but what do you think?

Make sense but I would say that involves adding new logic and sounds more like an enhancement than a bug fix alone. Following your last comment, should an issue be created to track that enhancement idea (validation logic + feedback icon when selecting a kernel connection file)?

@ccordoba12
Copy link
Member

ccordoba12 commented Oct 19, 2024

Make sense but I would say that involves adding new logic and sounds more like an enhancement than a bug fix alone. Following your last comment, should an issue be created to track that enhancement idea (validation logic + feedback icon when selecting a kernel connection file)?

Yeah, I think that's a good idea. Please create one so that we don't forget to address that later.

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Thanks @dalthviz!

@ccordoba12 ccordoba12 merged commit 9865971 into spyder-ide:master Oct 19, 2024
17 checks passed
@ccordoba12
Copy link
Member

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/spyder that referenced this pull request Oct 19, 2024
…doesn't exist and show error with info explaining that no connection was possible (IPython Console)
ccordoba12 pushed a commit that referenced this pull request Oct 19, 2024
…ile doesn't exist and show error with info explaining that no connection was possible (IPython Console)) (#22694)
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.

TypeError on connecting to spyder-notebook kernel
2 participants