Skip to content

venv: Activation in fish inside msys2 (or similar) breaks PATH #151042

@LuNoX

Description

@LuNoX

Bug report

Bug description:

When running source .venv/Scripts/activate.fish on windows from a fish shell inside msys2 ucrt64 it breaks the PATH.
Equivalently to gh-103325 activating a venv inside fish (from Cygwin, MSYS or MinGW) on windows will lead to mixing Unix and Windows path styles which then has knockon effects like breaking the PATH when

set -gx PATH "$VIRTUAL_ENV/"__VENV_BIN_NAME__ $PATH
runs.

To reproduce:

  • Boot a Windows partition
  • Install Cygwin, MSYS2, MinGW or equivalent
  • Install fish from inside Cygwin, MSYS2, MinGW or equivalent
  • Install python
  • cd into a python project of your choice
  • Run your installed python's venv command
  • Run echo $PATH
  • Run source .venv/Scripts/activate.fish
  • Run echo $PATH

Notice that the second PATH output contains a new broken/mismatched entry at the start which will in turn break all future uses of PATH.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-windowsstdlibStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduletype-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions