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: Prevent error when updating sys.path in consoles (IPython console) #22490

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

ccordoba12
Copy link
Member

Description of Changes

This happened when the kernel was not available and users opened/closed projects or used the Python path manager.

Issue(s) Resolved

Fixes #21563.

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:

if self.kernel_handler is not None:
self.call_kernel(interrupt=True, blocking=False).update_syspath(
path_dict, new_path_dict
)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the sys.path contents that was updated be saved somewhere to properly apply it when kernel_handler is available? Or maybe there is no possiblitiy that at some point later on the kernel_handler becomes available?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that and concluded it's not necessary because this error can only happen when the kernel is not available (because it errored at startup or the Spyder-kernels version is wrong).

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

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

Thanks @ccordoba12 !

@dalthviz dalthviz merged commit b65c1d5 into spyder-ide:master Sep 17, 2024
14 checks passed
@dalthviz
Copy link
Member

@meeseeksdev please backport to 6.x

meeseeksmachine pushed a commit to meeseeksmachine/spyder that referenced this pull request Sep 17, 2024
dalthviz added a commit that referenced this pull request Sep 18, 2024
…490-on-6.x

Backport PR #22490 on branch 6.x (PR: Prevent error when updating `sys.path` in consoles (IPython console))
@ccordoba12 ccordoba12 deleted the issue-21563 branch September 18, 2024 18:17
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.

Error while closing project just after Spyder starts
2 participants