Skip to content

source venv/bin/activate returns non-zero on systems with hashing disabled #149701

Closed

Description

@genericallyterrible

Bug report

Bug description:

After creating a venv with python -m venv .venv, attempting to source .venv/bin/activate on a system with hashing disabled successfully activates the venv, but returns non-zero.

bash-5.3$ set +h
bash-5.3$ hash
bash: hash: hashing disabled
bash-5.3$ python -m venv .venv
bash-5.3$ source .venv/bin/activate
(.venv) bash-5.3$ echo $?
1

This can make it appear that there was an error sourcing activate when there wasn't, especially for styled prompts that can color code based on command success such as starship.

Image

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs

Activity

  1. sepehr-rs commented on May 12, 2026

    @sepehr-rs
    Contributor

    Could someone also add the topic-venv label? This issue appears to be specific to the venv activation scripts.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    topic-venvRelated to the venv module
    on May 12, 2026
  3. added 4 commits that reference this issue on May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-venvRelated to the venv moduletype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions