Skip to content

[3.12.11] virtual env shell (ps1) prompt double parentheses around name #135979

Closed as duplicate

Description

@ds-cbo

Bug report

Bug description:

Steps to reproduce

$ python3.12 --version
Python 3.12.11

$ python3.12 -m venv /tmp/test

$ cat /tmp/test/bin/activate
...
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
    _OLD_VIRTUAL_PS1="${PS1:-}"
    PS1="("'(test) '") ${PS1:-}"
    export PS1
fi
...

Actual result

((test) ) original prompt here $

The double parentheses look weird.

Expected result

(test) original prompt here $

Workaround

Either disable the automatic prompt-setting with export VIRTUAL_ENV_DISABLE_PROMPT=1 and put an alternative prompt-editing logic in your shell profile

Or modify the bin/activate scripts to remove the extra parentheses manually

CPython versions tested on:

3.12

Operating systems tested on:

macOS

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Jun 26, 2025
  2. ds-cbo commented on Jun 26, 2025

    @ds-cbo
    Author

    Seems related to one of these commits:

    8edc802
    d48cc82

    Was not yet present in 3.11.13 and is already fixed in 3.13.5

  3. StanFromIreland commented on Jun 26, 2025

    @StanFromIreland
    Member

    It is unfortunately too late to fix this. You should update your python version.

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

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions