-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Closed
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-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
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error