Steve Dower <steve.do...@python.org> added the comment:

> The bit that I *do* think is a venv gotcha is that it's entirely reasonable 
> for a user to expect that if they run path\to\venv\Scripts\python.exe, then 
> their Python script will be run by that executable.

This is still true, though, as much as it's ever been. The gotcha is that 
launching "python" may not launch "path\to\venv\Scripts\python.exe" even if 
that's the first entry on PATH.

For the documentation, we could phrase it more positively as "If you need the 
path to the Python executable, use sys.executable. Relying on explicit or 
implicit PATH resolution may result in the wrong version of Python being used, 
especially when the user has launched from a virtual environment."

----------

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

Reply via email to