You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Windows venvs work under cygwin because the activate script checks for it and converts the path as necessary. Cygwin is old and the new way to run a Linux shell on Windows is through the Windows Subsystem for Linux (WSL). However, there is no check for it in the script, making it not work correctly.
The relevant snippet from the script is:
# on Windows, a path can contain colons and backslashes and has to be converted:case"$(uname)"in
CYGWIN*|MSYS*)
# transform D:\path\to\venv to /d/path/to/venv on MSYS# and to /cygdrive/d/path/to/venv on Cygwin
VIRTUAL_ENV=$(cygpath "__VENV_DIR__")export VIRTUAL_ENV
;;
*)
# use the path as-isexport VIRTUAL_ENV="__VENV_DIR__"
;;
esac
I was able to easily fix it manually by changing the reference to my project's venv path with $(wslpath -u "__VENV_DIR__"). All we need is a check for WSL in the script and another prong on this case statement. The best way to do this is probably by searching for "microsoft" or "wsl" in the output of uname -r. Some work might be needed to ensure this covers all edge cases.
Bug report
Bug description:
Currently, Windows venvs work under cygwin because the activate script checks for it and converts the path as necessary. Cygwin is old and the new way to run a Linux shell on Windows is through the Windows Subsystem for Linux (WSL). However, there is no check for it in the script, making it not work correctly.
The relevant snippet from the script is:
I was able to easily fix it manually by changing the reference to my project's venv path with
$(wslpath -u "__VENV_DIR__")
. All we need is a check for WSL in the script and another prong on this case statement. The best way to do this is probably by searching for "microsoft" or "wsl" in the output ofuname -r
. Some work might be needed to ensure this covers all edge cases.CPython versions tested on:
3.12
Operating systems tested on:
Windows
Linked PRs
venv
activate script #124155The text was updated successfully, but these errors were encountered: