Skip to content

🐛 fix(batch): preserve ! in PATH - #3665

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:fix/0yrl-batch-path-delayed
Nov 20, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:fix/0yrl-batch-path-delayed

Conversation

@gaborbernat

Copy link
Copy Markdown
Contributor

Batch activation and deactivation under cmd.exe /V:ON changed inherited PATH entries containing literal ! (#3617). Those entries now survive activation and return unchanged on deactivation.

The batch activation and deactivation scripts read saved PATH values through delayed expansion when the caller enables it. Each script checks the shell mode when it runs, so a mode change between activation and deactivation preserves the original PATH.

Fixes #3617. Reported by oss-scanner: ANT-2026-0YRL0MX4.

@gaborbernat
gaborbernat marked this pull request as draft November 20, 2026 06:44
@gaborbernat
gaborbernat force-pushed the fix/0yrl-batch-path-delayed branch 3 times, most recently from 06c4486 to f14fe28 Compare November 20, 2026 08:24
Read PATH through delayed expansion when cmd.exe enables it, so literal exclamation marks survive activation and deactivation.

Fixes pypa#3617
@gaborbernat
gaborbernat force-pushed the fix/0yrl-batch-path-delayed branch from f14fe28 to de5ec31 Compare November 20, 2026 09:09
@gaborbernat
gaborbernat marked this pull request as ready for review November 20, 2026 09:55
@gaborbernat
gaborbernat merged commit c71e1f2 into pypa:main Nov 20, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Batch activation changes inherited PATH under delayed expansion

1 participant