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

Jacob Bachmeyer <[email protected]>
Newsgroups gmane.comp.sysutils.automake.patches
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.