Skip to content

conda environments requiring admin rights cause 100 percent CPU usage on Win #9473

Closed
@melund

Description

@melund

Environment data

  • VS Code version: 1.41.1
  • Extension version: 2020.1.57204
  • OS and version: Windows_NT x64 10.0.19041
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7 Anaconda
  • Type of virtual environment used: conda

Expected behaviour

VS code should start up fast and detect conda environments on the machine.

Actual behaviour

Some python processes uses 100 % CPU and hangs when VS code starts.

The hanging processes are using conda run to query conda environments info using ms-python.python-2020.1.57204\pythonFiles\interpreterInfo.py.

This process hangs if the conda-environments are in locations which require admin rights.

The problem is caused by a bug conda-run conda/conda#9574 which creates temporary files directly in the environments instead of the tempfile folders. This again triggers a long standing Python bug in the tempfile module.

Steps to reproduce:

  1. Create an environment
  2. Move a environment to a place requiring admin rights E.g. "c:/conda-env"
  3. Start VS code and wait for Python extension to query the environment with conda run

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions