automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] python: prioritize python 3.x over 2.x


From: Jacob Bachmeyer
Subject: Re: [PATCH] python: prioritize python 3.x over 2.x
Date: Thu, 27 Jan 2022 20:20:09 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0

Zack Weinberg wrote:
On Wed, Jan 26, 2022, at 10:10 PM, Mike Frysinger wrote:
On 26 Jan 2022 10:07, Zack Weinberg wrote:
Please also move the plain "python" command down to the python2
block (right after "python2" would be the best place I think).  Any
system on which "python" runs Python 3 is grossly misconfigured.
i don't think that's accurate.  Python PEP-0394 explicitly permits
`python` to be any version, and many distros do just that

Yes, I know.  PEP 394 is wrong.  Its authors grossly underestimated
the volume of Python 2 code that still exists today and, if
accidentally executed with a v3 interpreter, will *silently*
malfunction -- not just crashing, but corrupting data with no warning.
I had to deal with this kind of code all the time in my previous day
job and I'm still quite peeved that the Python devs blew me off about it.

What PEP 394 *should* have said is that the command name "python" and
the #! path /usr/bin/python MUST[rfc2119] be *permanently reserved*
for the Python 2.7 interpreter, and "python3" is the only acceptable
not-specifically-versioned command name for the 3.x interpreter, even
in virtualenvs.

distros that remove `python` entirely as part of Python 2 removal
are doing it wrong.

On the contrary, those distros are the only ones doing it right.

Now, nobody listens to me, and I'm painfully aware that "python"
pointing to Python 3 is common, but that doesn't mean Autotools should
make the situation even worse.  Autotools should, on its own motion,
discourage the use of "python".  Thus, my suggested changes.

Are Python 2 and Python 3 different enough that perhaps Automake should have separate AM_PATH_PYTHON2 and AM_PATH_PYTHON3 macros, with AM_PATH_PYTHON deprecated, since few programs can usefully run with either Python 2 or 3?

In other words, are we conflating two features behind "PYTHON" that are actually logically separate?


-- Jacob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]