New submission from Segev Finer <segev...@gmail.com>:
When using the common "#!/usr/bin/env python" shebang, recent versions of the Python launcher will search the PATH for "python" as specified in the shebang. But Python on Windows installs as python.exe for all versions, both 2 and 3. So in a PC where Python 3 is first on PATH, this shebang will choose Python 3. That's in contrast to any other shebang like "#!python" or "#!/usr/bin/python" which will prefer Python 2. That's rather subtle and confusing... To the best of my knowledge most Linux distros still install Python 2 as python and Python 3 as python3 (I think that's in the Makefile too). But of course there might also be distros that install python3 as python. ---------- title: Python launcher behavior with /usr/bin/env python shebang -> Python launcher behavior with "#!/usr/bin/env python" shebang _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34274> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com