Skip to content

Conversation

@bgobbi
Copy link
Contributor

@bgobbi bgobbi commented Dec 13, 2020

Current Behavior

When using csh or tcsh only
After using "conda activate env" for the first time issuing "conda env list" adds the conda/bin directory as a prefix to the PATH variable causeing future python execution to use a non-intended python version.
Even worse: every time "conda env list is issued a new "conda/bin" is prefixed to the PATH variable.
The same issue happens when an conda command is executed the results in an error e.g "conda activate non_existing".

Steps to Reproduce

  • setup conda for csh
  • create a new environment "py"
  • conda activate py
  • 'which python` gives correct path to py/python executable
  • conda env list
  • 'which python` gives incorrect path to conda/bin/python

Expected Behavior

"conda env list" or any informational or invalid conda com and should not affect the PATH variable

Cause

This problem is caused by conda.csh line 29

setenv PATH "`dirname ${_CONDA_EXE}`:$PATH"

It modifies the path environment variable. That change is reversed in cases when the
eval statements are executed (line 33,38 or 44) but if an error happens in lines (32, 37 or 43)
or if the "default:" statement is executed the path variable is left unchanged with the altered value.

Solution

The proposed solution stores the value of the Path variable and restores it in case of error or in the default branch of the switch statement when no "eval" statement is executed that would set the PATH variable correctly.

@bgobbi bgobbi requested a review from a team as a code owner December 13, 2020 21:00
@anaconda-issue-bot
Copy link

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @bgobbi. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@bgobbi
Copy link
Contributor Author

bgobbi commented Dec 21, 2020

I have signed the cla multiple times now. Even so this is still marked as "failed" here. I do not know what to do.

@cjmartian
Copy link
Contributor

@anaconda-issue-bot check

@anaconda-issue-bot anaconda-issue-bot added the cla-signed [bot] added once the contributor has signed the CLA label Jan 4, 2021
@cjmartian cjmartian merged commit ecaaad9 into conda:master Jan 6, 2021
@cjmartian
Copy link
Contributor

Thank you @bgobbi!

@chenghlee chenghlee added this to the 4.10.0 milestone Mar 30, 2021
@github-actions
Copy link

github-actions bot commented Apr 5, 2022

Hi there, thank you for your contribution!

This pull request has been automatically locked because it has not had recent activity after being closed.

Please open a new issue or pull request if needed.

Thanks!

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Apr 5, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants