![](https://secure.gravatar.com/avatar/d47ffb8bab39ac341dc4c6b1465896e8.jpg?s=120&d=mm&r=g)
On Wed, Jul 22, 2020 at 4:34 PM Tzu-ping Chung <uranusjr@gmail.com> wrote:
If the shebang needs to care about compatibility, something is already going very wrong.
We agree there, and it has. That python3 was not completely backwards compatible with python2 meant that it broke a lot of code. The EOL of python2 and the apparent intent of the major distros to drop it means that unmaintained python code will become unusable code. Neither of these outcomes is common for a major computer language. For instance, old K&R style C or F77 code from the 1990's will still compile with modern compilers (albeit with a blizzard of warning messages and possibly 32 bit to 64 bit issues). This matters quite a bit in scientific circles because published computational work becomes unreproducible if the tools break even when the input data is still available. When these issues are encountered I notify the program's author, assuming that there is still somebody maintaining the code. The most recent instance of this was "lastz" http://www.bx.psu.edu/~rsharris/lastz/ which in addition to the lastz program itself contains a bunch of python scripts. The shebang's used "python", they were Python2 code, and so they didn't work. The author in this case agreed that was a problem and is currently working on upgrading those scripts. I think the intent of the first quoted section was to say that if a script used a feature in Python 3.N that was absent in 3.(N-1) and below then 3.N should be used. That is perfectly reasonable. What isn't reasonable is the assumption that using just "python" is not a problem in a language which demonstrably does not maintain backwards compatibility between major versions (see above). Perhaps this circle could be squared if python had a "-r" (single letter for standard) command line parameter, then this: #!/usr/bin/env python -r N.M could conceivably be handled gracefully by the single "python", even if only to throw an error and state that version "N.M" is not supported. That would be far better than responding to version incompatibility with a slew of syntax errors, which is what happens now. It would handle both "2.7 is too old" and "3.9 required but this is a 3.8 installation". Regards, David Mathog
TP
Regards,
David Mathog -- Distutils-SIG mailing list -- distutils-sig@python.org To unsubscribe send an email to distutils-sig-leave@python.org https://mail.python.org/mailman3/lists/distutils-sig.python.org/ Message archived at https://mail.python.org/archives/list/distutils-sig@python.org/message/HAZUE...