Wolfgang Maier added the comment:

> Hmm, I didn't know that (although virtualenv-based environments don't have an 
> equivalent to pyvenv.cfg).

Well, that complicates things then :(
 
> But there's some confusion here. This patch only affects command line usage 
> (running "py.exe" to start Python). I don't really see a use case for making 
> "py -3" mean "the virtualenv if it's Python 3 otherwise ignore the virtualenv 
> and use the system Python 3".
> 
> For scripts, shebang processing isn't altered. Nothing uses a virtualenv 
> except "#!/usr/bin/env python". And that does so only because it searches 
> PATH before looking at the registry. If you use "#!/usr/bin/env python3" it 
> won't see a virtualenv because there is no python3.exe in a virtualenv...
>

Well, and that's exactly what I think is a mistake ...
 
> 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.

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 :(

----------

_______________________________________
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

Reply via email to