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

PATH user environment variable is incorrectly transmitted to the IPython Console for macOS shortcuts #23711

Open
mrclary opened this issue Feb 11, 2025 · 3 comments · May be fixed by #23761
Open

Comments

@mrclary
Copy link
Contributor

mrclary commented Feb 11, 2025

When launching Spyder via shortcut on macOS, the PATH environment variable passed to the IPython Console is incorrect.
This is due to

# Ensure that user environment variables are included, but don't
# override existing environ values
env_vars = get_user_environment_variables()
env_vars.update(os.environ)

introduced by #21065.

I think that the user environment variables should take precedence over the Spyder runtime environment variables. I do not know of any reason why it should not be this way.

@ccordoba12
Copy link
Member

I think that the user environment variables should take precedence over the Spyder runtime environment variables.

Sure, I agree with that. So, do you propose to change that code to be something like this?

env_vars = os.environ.copy()
env_vars.update(get_user_environment_variables())

@mrclary
Copy link
Contributor Author

mrclary commented Feb 17, 2025

I think that the user environment variables should take precedence over the Spyder runtime environment variables.

Sure, I agree with that. So, do you propose to change that code to be something like this?

env_vars = os.environ.copy()
env_vars.update(get_user_environment_variables())

Precisely.

@ccordoba12
Copy link
Member

Ok, please open a PR to implement that change then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants