From 476b649728201e78c38cc165c2fba841e392cf82 Mon Sep 17 00:00:00 2001 From: LuNoX Date: Mon, 22 Jun 2026 06:21:00 +0200 Subject: [PATCH] gh-151042: venv: Pass VIRTUAL_ENV through cygpath inside fish on Windows (GH-151043) --- Lib/venv/scripts/common/activate.fish | 3 +++ .../Library/2026-06-07-13-47-05.gh-issue-151042.NMdzF2.rst | 1 + 2 files changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-06-07-13-47-05.gh-issue-151042.NMdzF2.rst diff --git a/Lib/venv/scripts/common/activate.fish b/Lib/venv/scripts/common/activate.fish index 284a7469c99b..e8225f6db5b5 100644 --- a/Lib/venv/scripts/common/activate.fish +++ b/Lib/venv/scripts/common/activate.fish @@ -34,6 +34,9 @@ end deactivate nondestructive set -gx VIRTUAL_ENV __VENV_DIR__ +if string match -qr 'CYGWIN|MSYS|MINGW' (uname) + set -gx VIRTUAL_ENV (cygpath -u $VIRTUAL_ENV) +end set -gx _OLD_VIRTUAL_PATH $PATH set -gx PATH "$VIRTUAL_ENV/"__VENV_BIN_NAME__ $PATH diff --git a/Misc/NEWS.d/next/Library/2026-06-07-13-47-05.gh-issue-151042.NMdzF2.rst b/Misc/NEWS.d/next/Library/2026-06-07-13-47-05.gh-issue-151042.NMdzF2.rst new file mode 100644 index 000000000000..a24a15c0cc26 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-06-07-13-47-05.gh-issue-151042.NMdzF2.rst @@ -0,0 +1 @@ +Fixed venv exporting mixed path styles to PATH on Windows inside fish (via Cygwin, MinGW or MSYS2) -- 2.47.3