-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
The venv/scripts/common/activate script calls hash -r
in two places to make sure the shell picks up the environment changes the script makes. Before that, it checks to see if the shell running the script is bash or zsh.
cpython/Lib/venv/scripts/common/activate
Lines 20 to 22 in fb202af
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then | |
hash -r 2> /dev/null | |
fi |
cpython/Lib/venv/scripts/common/activate
Lines 75 to 77 in fb202af
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then | |
hash -r 2> /dev/null | |
fi |
hash -r
is specified by POSIX and is not exclusive to bash and zsh. This guard will prevent the script from calling hash -r
in other #!/bin/sh
-compatible shells like dash.
CPython versions tested on:
3.11, 3.12, 3.13
Operating systems tested on:
macOS, Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error