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: Fix UnboundLocalError when removing and adding paths to Pythonpath Manager #22850

Merged
merged 5 commits into from
Nov 5, 2024

Conversation

mrclary
Copy link
Contributor

@mrclary mrclary commented Nov 5, 2024

Description of Changes

Fix issue where user_widget was not defined if self.user_header was defined but not visible in the PYTHONPATH Manager widget.
Reject PYTHONPATH paths that match conda base environment /pkgs directory.

Issue(s) Resolved

Fixes #22827

…efined but not visible.

This occurs when all paths are removed and then a new path is added, causing an error. Now the header is always destroyed and recreated, avoiding situation where the header is not visible.
@mrclary mrclary changed the title PR: Issue 22827 PR: Fix UnboundLocalError when removing and adding paths to PYTHONPATH Manager Nov 5, 2024
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 for your work on this @mrclary! I left a suggestion and small question for you, the rest looks good to me.

spyder/plugins/pythonpath/utils.py Outdated Show resolved Hide resolved
spyder/plugins/pythonpath/utils.py Outdated Show resolved Hide resolved
@ccordoba12 ccordoba12 changed the title PR: Fix UnboundLocalError when removing and adding paths to PYTHONPATH Manager PR: Fix UnboundLocalError when removing and adding paths to PYTHONPATH Manager Nov 5, 2024
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.

Looks good to me now, thanks @mrclary!

@ccordoba12 ccordoba12 changed the title PR: Fix UnboundLocalError when removing and adding paths to PYTHONPATH Manager PR: Fix UnboundLocalError when removing and adding paths to Pythonpath Manager Nov 5, 2024
@ccordoba12 ccordoba12 merged commit 631bb39 into spyder-ide:master Nov 5, 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 Nov 5, 2024
…ng and adding paths to Pythonpath Manager
ccordoba12 pushed a commit that referenced this pull request Nov 5, 2024
…moving and adding paths to Pythonpath Manager) (#22858)
@mrclary mrclary deleted the issue-22827 branch November 5, 2024 22:51
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.

Attempt to add path in Anaconda3/pkgs to Pythonpath manager leads to an error
2 participants