-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 setting user environment variables on Windows #22075
Conversation
I encountered another issue when investigating this. When removing an environment variable, it is not removed from the registry. I think some discussion and more work would be required to fix this issue, since this requires more than just over-writing existing variables. Also related may be #3891. |
…fine a `CONF_SECTION` class attribute! Hint: <spyder.widgets.collectionseditor.CollectionsEditorWidget object at 0x0000021679642320> or its parent should define the section."
…ype." When inserting new variable in user environment variables on Windows, the value may not be a string and results in the error above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help with this @mrclary! Just a clarifying suggestion for you, the rest looks good to me.
Co-authored-by: Carlos Cordoba <ccordoba12@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mrclary!
Note: The failure in our tests is unrelated to this.
Description of Changes
When adding user environment variables to Windows registry, the value must be a string. Under some circumstances, the user provided value may be numeric resulting in
ValueError: Could not convert the data to the specified type.
. Applyingclean_env
resolves this issue.Also, a user warning
UserWarning: A SpyderConfigurationObserver must define a `CONF_SECTION` class attribute!
was encountered when launching the User environment variable widget. This was fixed by addingCONF_SECTION = 'main'
to theCollectionsEditorWidget
class.Issue(s) Resolved
Fixes #21771
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: