Paul Moore added the comment: On 20 February 2015 at 16:31, Wolfgang Maier <rep...@bugs.python.org> wrote: >> The scope of this PEP is just to make the "py" command (with no explicit >> version) use an active virtualenv before falling back to the default Python. >> This is specifically to allow people who don't put Python on their PATH but >> use virtualenvs to use "py" consistently, rather than having to switch to >> "python" when they are in a virtualenv. See the PEP (specifically the >> rationale section) for details. >> > > Right, just that > > #!/usr/bin/env python3 > > is a very plausible shebang line for a Python3 script for use under UNIX > where #!/usr/bin/env python typically means python2.
That seems completely reasonable. Presumably this works for Unix because virtualenvs have a "python3" executable installed, not just a "python" executable? > So, with the current patch users could still not use the py launcher from a > virtual environment with scripts that are supposed to work under UNIX :( Correct. That's not the problem this PEP is intended to solve. Another PEP could be written to look at this, but I suspect it could be quite hard to balance the various issues involved. As a start, maybe the Python Windows installer should be writing a "python3.exe" as well as "python.exe" and venv should put that in the virtualenv. (That's certainly something that has been suggested in the past). That may be a simpler solution than adding yet more complexity and special cases to the launcher. Personally, I don't have a need for this functionality, so I'm happy to leave that PEP to someone else to write. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23465> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com