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.

classification
Title: In venv, __VENV_NAME__ is the prompt, not the name
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: carljm, paul.moore, python-dev, vinay.sajip
Priority: normal Keywords: patch

Created on 2013-10-01 17:58 by paul.moore, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
venv_prompt.patch paul.moore, 2013-10-01 18:28 review
Messages (5)
msg198795 - (view) Author: Paul Moore (paul.moore) * (Python committer) Date: 2013-10-01 17:58
The documentation for venv states that __VENV_NAME__ in scripts is replaced by the name of the virtualenv. In fact, it is replaced by context.prompt, which is the prompt, rather than the name.

The various activate scripts are not consistent with this behaviour. Most seem to expect a prompt, but activate.csh does not.

I would prefer __VENV_NAME__ to actually *be* the name, and either have an extra substitution variable __VENV_PROMPT__ or just leave it to the scripts themselves to format the prompt using the name.

I could supply a patch (it's not hard) but would need agreement on the right approach.
msg198797 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2013-10-01 18:16
Makes sense to me. Adding Carl Meyer to nosy, to see if he has a different view.
msg198799 - (view) Author: Carl Meyer (carljm) * Date: 2013-10-01 18:23
Makes sense to me.
msg198800 - (view) Author: Paul Moore (paul.moore) * (Python committer) Date: 2013-10-01 18:28
Cool. Patch attached (this fixes __VENV_NAME__ and implements __VENV_PROMPT__)
msg198825 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-02 10:36
New changeset 7f913c6ada03 by Vinay Sajip in branch 'default':
Closes #19139: Changed usage of __VENV_NAME__ and added __VENV_PROMPT__.
http://hg.python.org/cpython/rev/7f913c6ada03
History
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63338
2013-10-02 10:36:33python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg198825

resolution: fixed
stage: resolved
2013-10-01 18:28:39paul.mooresetfiles: + venv_prompt.patch
keywords: + patch
messages: + msg198800
2013-10-01 18:23:35carljmsetmessages: + msg198799
2013-10-01 18:16:34vinay.sajipsetnosy: + carljm
messages: + msg198797
2013-10-01 17:58:33paul.moorecreate