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
{{ message }}
Repository navigation
PowerShell venv activation treats square brackets in paths as wildcards #159498
PowerShell activation uses wildcard-aware path lookups for the script directory and pyvenv.cfg. Square brackets in an environment's path can prevent activation or select a similarly named sibling directory.
Activation reports You cannot call a method on a null-valued expression. It should activate the environment and use the configured prompt.
An existing sibling directory named venv1/Scripts can also cause the internal directory lookup for venv[1]/Scripts to select that sibling instead of the intended environment.
The relevant lookups in Lib/venv/scripts/common/Activate.ps1 use Get-Item -Path, Join-Path -Resolve -Path, and Get-Content -Path. They need to treat filesystem paths literally.
CPython versions tested on
3.15.0 and the 3.16 development branch at fdec4df45ab69fc25019565992d95b26b4e37523, with PowerShell 7.6.5 and Windows PowerShell 5.1.
Activity