Skip to content

馃悰 fix(activation): escape PowerShell curly single quotes - #3325

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:fix/powershell-curly-quote
Sep 26, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:fix/powershell-curly-quote

Conversation

@gaborbernat

Copy link
Copy Markdown
Contributor

PowerShell accepts the curly quotes U+2018鈥揢+201B as single-quote delimiters, and PowerShellActivator.quote() doubled only the ASCII '. 馃悰 A prompt or Tcl/Tk library path holding one of them closed the literal in activate.ps1 and ran the rest as a command; this reproduces with pwsh 7.6.

quote() now doubles all five delimiters, the same escape PowerShell uses for '.

@gaborbernat gaborbernat added bug security Fixes a vulnerability or hardens the supply chain, CI or release labels Sep 26, 2026
PowerShell treats U+2018-U+201B as single-quote delimiters just like the
ASCII apostrophe, so a prompt, environment name or Tcl/Tk library path
carrying one closed quote()'s literal early and ran the trailing text.
Double each of those code points too, matching how PowerShell escapes a
quote inside a single-quoted string.
@gaborbernat
gaborbernat force-pushed the fix/powershell-curly-quote branch from 3629b4b to b5a804d Compare September 26, 2026 16:12
@gaborbernat
gaborbernat merged commit 876c5ba into pypa:main Sep 26, 2026
66 checks passed
@gaborbernat
gaborbernat deleted the fix/powershell-curly-quote branch October 3, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug security Fixes a vulnerability or hardens the supply chain, CI or release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant