[issue38999] Python launcher on Windows does not detect active venv

2021-03-26 Thread Eryk Sun
Eryk Sun added the comment: > I realize one could interpret the python3 in the shebang as an > "explicit version specification", but a) that's not on the > command line, which seems the more natural reading and b) it's > only a partial specification, since it doesn't say which python3 > to

[issue38999] Python launcher on Windows does not detect active venv

2019-12-24 Thread Ross Boylan
Ross Boylan added the comment: As someone who finds the current behavior surprising, and having lost significant time because of it, I have a couple of comments. 1) If the venv created a python3 (or 2, as appropriate) file, would the expected behavior with !#/usr/bin/env python3 be restored?

[issue38999] Python launcher on Windows does not detect active venv

2019-12-12 Thread Steve Dower
Steve Dower added the comment: > Do you mean all shebangs, including those with a native file path? I like the idea as a whole, but ultimately end up disliking all the available options (in the context of py.exe, that is). * Unix/virtual shebangs don't work reliably on Windows (as we can

[issue38999] Python launcher on Windows does not detect active venv

2019-12-12 Thread Eryk Sun
Eryk Sun added the comment: > I think supporting the shebang line in py.exe is a misfeature and > would prefer we'd never done it (though it predates my involvement). Do you mean all shebangs, including those with a native file path? Or do you mean just virtual shebangs, and in particular

[issue38999] Python launcher on Windows does not detect active venv

2019-12-11 Thread Steve Dower
Steve Dower added the comment: > This makes it simple for users to intervene via the PATH (which is the whole > point of /usr/bin/env) and launch whatever they want. That's one point of view, but the other is that the whole point of the shebang line is for users to be able to run the script

[issue38999] Python launcher on Windows does not detect active venv

2019-12-11 Thread Alexandros Karypidis
Alexandros Karypidis added the comment: My suggestion to gradually fall back from most specific to least specific version, was an attempt to reconcile the input from various viewpoints. I think that ideally the behaviour should be as close to UNIX as possible. This means that it should just

[issue38999] Python launcher on Windows does not detect active venv

2019-12-10 Thread Eryk Sun
Eryk Sun added the comment: I don't think the "/usr/bin/env" case needs to limit qualified names like "python3[.x]" to registered installations. This is a choice made to simplify the implementation. If it finds a generic "python.exe" executable in PATH, for 3.5+ it is possible to query

[issue38999] Python launcher on Windows does not detect active venv

2019-12-09 Thread Alexandros Karypidis
Alexandros Karypidis added the comment: I think this situation is not ideal and the limitation seems artificial. If I understand correctly, there are two parameters that govern the behaviour of the python launcher: 1) Is the shebang using /usr/bin/env or not? 2) IS the shebang specifying a

[issue38999] Python launcher on Windows does not detect active venv

2019-12-09 Thread Paul Moore
Paul Moore added the comment: See PEP 486 (https://www.python.org/dev/peps/pep-0486/). This is intended behaviour, as it is assumed that explicitly specifying a Python version means that the user had a specific Python interpreter in mind. There are also technical issues - if the shebang

[issue38999] Python launcher on Windows does not detect active venv

2019-12-09 Thread Paul Moore
Change by Paul Moore : -- Removed message: https://bugs.python.org/msg358060 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue38999] Python launcher on Windows does not detect active venv

2019-12-09 Thread Paul Moore
Paul Moore added the comment: See PEP 486 (https://www.youtube.com/watch?v=Lmq13nrEFaM=PLuE3ABw6vYeR0gcPT6uj25ZZhmSP9vRB2=28=0s). This is intended behaviour, as it is assumed that explicitly specifying a Python version means that the user had a specific Python interpreter in mind. There

[issue38999] Python launcher on Windows does not detect active venv

2019-12-08 Thread Alexandros Karypidis
Alexandros Karypidis added the comment: As confirmed by debug information when setting PYLAUNCH_DEBUG=1, the shebang seems to be ignored when using '#!//usr/bin/env python3' but works fine when using '#!//usr/bin/env python'. This is with '#!//usr/bin/env python' (proper):

[issue38999] Python launcher on Windows does not detect active venv

2019-12-08 Thread Alexandros Karypidis
Alexandros Karypidis added the comment: Forgot the simple script: #!/usr/bin/env python3 import os, sys, platform print('EXECUTABLE: ' + sys.executable) print('PREFIX: ' + sys.prefix) print('BASE PREFIX: ' + sys.base_prefix) -- ___ Python

[issue38999] Python launcher on Windows does not detect active venv

2019-12-08 Thread Alexandros Karypidis
New submission from Alexandros Karypidis : When you activate a venv on Windows and use a shebang with a major verion qualifier, the python launcer does not properly detect that a venv is active and uses the system installation instead. The incorrect behavior is documented in this SO question