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 cheryl.sabella
Recipients brett.cannon, cheryl.sabella, steve.dower, vinay.sajip
Date 2019-01-21.20:13:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1548101630.55.0.137725549341.issue35661@roundup.psfhosted.org>
In-reply-to
Content
I've made the changes suggested by Brett to store the raw value instead of the formatted prompt.  

I also have been looking into issues Steve raised about using the prompt value from `pyvenv.cfg` instead of having the prompt hard-coded into the activate scripts.  Since these scripts are .bat, bash, Powershell, etc scripts, I didn't know if there was anything special that needed to be taken into account (such as encoding) to use the values from the config file.  As Steve said, I could see this being opened as a bug in the future, so I don't mind working on it now in this issue or a separate one, whichever is the better option.  I just don't have much experience with those types of scripts, so I'm sure any changes I make will require some time and a lot of code review.  Plus, those changes add complexity to this change that Brett said he doesn't really need for his initial request.  Because of the possibility of changing those scripts soon, I've left the key name as `prompt` for now.  Fixing the activate scripts seems to be the right way to go instead of changing the name so it's not misused.

One thing that I did find which may be a current bug is:
> PS N:\projects\cpython> python -m venv myvenv --prompt='this is my prompt'
> Running Release|Win32 interpreter...
> PS N:\projects\cpython> .\myvenv\Scripts\activate
> (this is my prompt) PS N:\projects\cpython> deactivate
> PS N:\projects\cpython> python -m venv myvenv --upgrade --prompt='new prompt'
> Running Release|Win32 interpreter...
> PS N:\projects\cpython> .\myvenv\Scripts\activate
> (this is my prompt) PS N:\projects\cpython>

--upgrade changes the prompt on `pyvenv.cfg`, but doesn't update activate scripts, so the prompt doesn't really change.

And for reference, there is another bug issue for storing the --prompt value in an environment variable (#35328).
History
Date User Action Args
2019-01-21 20:13:51cheryl.sabellasetrecipients: + cheryl.sabella, brett.cannon, vinay.sajip, steve.dower
2019-01-21 20:13:50cheryl.sabellasetmessageid: <1548101630.55.0.137725549341.issue35661@roundup.psfhosted.org>
2019-01-21 20:13:50cheryl.sabellalinkissue35661 messages
2019-01-21 20:13:50cheryl.sabellacreate