Skip to content

Commit 9e36819

Browse files
committed
Convert paths in venv activate script when using Git Bash under Windows
With #112508 the check to converts paths when running on Windows was changed from using the non-posix environment variable `$OSTYPE` to using `uname` instead. However this missed the fact that when running under Git Bash on Windows, uname reports `MINGW*` (`$OSTYPE` is still `msys`). This results in `$PATH` being set to something like `D:\a\github-actions-shells\github-actions-shells\venv/Scripts:…`, instead of `/d/a/github-actions-shells/github-actions-shells/venv/Scripts`. Notably, the Git Bash is the bash shell that’s used for GitHub Actions Windows runners, and ships with VSCode.
1 parent 283ea5f commit 9e36819

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/venv/scripts/common/activate

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ deactivate nondestructive
3838

3939
# on Windows, a path can contain colons and backslashes and has to be converted:
4040
case "$(uname)" in
41-
CYGWIN*|MSYS*)
42-
# transform D:\path\to\venv to /d/path/to/venv on MSYS
41+
CYGWIN*|MSYS*|MINGW*)
42+
# transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW
4343
# and to /cygdrive/d/path/to/venv on Cygwin
4444
VIRTUAL_ENV=$(cygpath "__VENV_DIR__")
4545
export VIRTUAL_ENV

0 commit comments

Comments
 (0)