[issue41626] port shebang of tools from python2 to python3

Terry J. Reedy report at bugs.python.org
Thu Oct 22 03:06:08 EDT 2020


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Thoughts I wrote on the PR that belong here.  (Thanks for the reminder,  Éric.):
*The use of #! in both stdlib and tools seems rather inconsistent.

* Stdlib modules are best run with <python> -m mod so as to run the code with the exact python binary they are meant for. So maybe the marker should be be removed at least from /Lib/*.  But...

-- I was not really aware of idlelib.pyshell.  Running with an explicit  binary seems particularly important for IDLE.  About once a month on SO, some beginner posts about not being able to import a module they downloaded when running IDLE (maybe only sometimes).  Nearly always, they have 2 pythons, such as from Anaconda and python.org.

I may want or need to deprecate using pyshell as entry instead of idle.py/idlew.py/idle.bat as I want to move startup code from pyshell to either idle.py or a separate startup only file.  I am not sure how to get from here to there, partly because I don't really know what 'here' is in practice. 

* With 2.7 put to bed, the line is hardly needed to select between latest 2.x and latest 3.x.

* The response of py.exe to shebang lines needs to be detailed and considered.  I believe it only knows about python.org installs, so it will only start the latest python.org install.  I don't know what it does if 32- and 64- bit versions are both present.  I also don't know what it runs if the 'default' installed version is not the latest installed version.  Does py.exe know what the default is, or does that just affect what 'python' runs?

----------
nosy: +terry.reedy

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41626>
_______________________________________


More information about the Python-bugs-list mailing list