Skip to content

Project-local venv used by default in unrelated folder. #5968

@ericsnowcurrently

Description

@ericsnowcurrently

The extension knows how to find a variety of interpreter environments. This includes venvs in the ".venv" folder directly under the workspace folder, which are project-local. Such an env should not be visible to other workspace folders. I found a case where it gets used by default for a new workspace.

Repro:

  1. create folder: "testing"
  2. run python3 -m venv testing/.venv
  3. run code testing
  4. open a .py file
  5. set the interpreter env to "testing/.venv"
  6. close the folder
  7. create another folder: "eggs"
  8. run code eggs
  9. open a .py file

At that point the extension uses "testing/.venv" as the env. However, the workspace for the "eggs" folder should not know about that interpreter, since it is local to another workspace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions