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

"conda env remove" will delete a directory named like the environment #3814

Closed
sdvillal opened this issue Nov 5, 2016 · 3 comments
Closed
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type

Comments

@sdvillal
Copy link
Contributor

sdvillal commented Nov 5, 2016

This is, I think, a very unfortunate bug of conda-env:

mkdir -p test/i-do-not-want-to-delete-this-dir
cd test
conda env remove -n i-do-not-want-to-delete-this-dir

conda goes wild and deletes the i-do-not-want-to-delete-this-dir directory.

I'm on these versions of conda/conda-env:

conda                     4.1.12                   py27_0    conda-forge
conda-env                 2.5.2                    py27_0    conda-forge
@sdvillal
Copy link
Contributor Author

sdvillal commented Nov 5, 2016

Note that this happens only if the environment does not exist. Extended example:

mkdir -p test/i-do-not-want-to-delete-this-dir
conda create -n i-do-not-want-to-delete-this-dir python
cd test
# run this, the environment gets removed and the directory is not touched
conda env remove -n i-do-not-want-to-delete-this-dir  
# run it again, the directory is removed
conda env remove -n i-do-not-want-to-delete-this-dir

@sdvillal sdvillal added the type::bug describes erroneous operation, use severity::* to classify the type label Nov 7, 2016
@dsm054
Copy link

dsm054 commented Mar 23, 2017

I just got burned by this. One of my team speculated that it might be a consequence of some legacy local-folder-environment support, but whether that's true or not it seems needlessly dangerous in practice.

ramseydsilva added a commit to ramseydsilva/conda that referenced this issue Mar 23, 2017
kalefranz pushed a commit to kalefranz/conda that referenced this issue May 2, 2017
kalefranz added a commit to kalefranz/conda that referenced this issue May 2, 2017
kalefranz added a commit that referenced this issue May 2, 2017
fix #3814 don't remove directory that's not a conda environment
@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This issue has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Oct 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type
Projects
None yet
Development

No branches or pull requests

3 participants