This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients brett.cannon, vinay.sajip
Date 2019-07-23.19:17:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563909427.85.0.687567591149.issue37661@roundup.psfhosted.org>
In-reply-to
Content
If you look at https://github.com/python/cpython/blob/master/Lib/venv/__init__.py#L112-L113 you will see that the prompt context for a virtual environment is always set. Then if you look at the string substitutions for the activation scripts you will also see that the string substitution for __VENV_PROMPT__ is thus always done.

This is an issue as it means that for the fish and bash activation scripts they have erroneous checks for custom prompts. I.e. https://github.com/python/cpython/blob/master/Lib/venv/scripts/posix/activate.fish#L55 for fish and https://github.com/python/cpython/blob/master/Lib/venv/scripts/common/activate#L57 for bash will never fail, halting any other further checks unless one creates a custom EnvBuilder class which will make sure the prompt context stays empty all the way to string substitution. This impacts the colouring of the prompt in fish as that's only done if there is no default prompt (which is never true).
History
Date User Action Args
2019-07-23 19:17:07brett.cannonsetrecipients: + brett.cannon, vinay.sajip
2019-07-23 19:17:07brett.cannonsetmessageid: <1563909427.85.0.687567591149.issue37661@roundup.psfhosted.org>
2019-07-23 19:17:07brett.cannonlinkissue37661 messages
2019-07-23 19:17:07brett.cannoncreate