Cheryl Sabella <cheryl.sabe...@gmail.com> added the comment:

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 no
 t 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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35661>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to