On October 23, 2020 12:10:07 PM CDT, Bruce Dubbs via blfs-dev 
<blfs-dev@lists.linuxfromscratch.org> wrote:
>On 10/23/20 12:00 PM, Ken Moffat via blfs-dev wrote:
>> On Fri, Oct 23, 2020 at 11:22:06AM -0500, Bruce Dubbs via blfs-dev
>wrote:
>>>> Is there an official python recommendation for that, to quote at
>>>> them, please ?
>>>
>>> That's a good question, but I would also like to see if there is a
>survey of
>>> the major distros on the subject. I know arch has had
>python->python3 for a
>>> long time, but I don't know what Debian, Gentoo, Fedora, SUSe,
>Slackware,
>>> etc currently do.  Does anyone know or have access to systems that
>can
>>> easily check?
>>>
>>> In the past most had python->python2 because that was baked into the
>p2
>>> Makefile.  Creating a symlink is not in the current p3 Makefile.
>
>> I think Arch followed fedora in symlinking python3 to python.
>> 
>> Gentoo is complicated - python is used for a lot of their build
>> system and they have 'slots' for multiple versions.  It looks as if
>> they don't have a python symlink, but I guess there could be such a
>> symlink while (re)building a package.
>> 
>> https://wiki.gentoo.org/wiki/Python
>> 
>> Ubuntu seems to be removing /usr/bin/python from a comment re 20.04
>that
>> somebody's desktop has it from the python-is-python2 package, but
>that his
>> other systems don't have python2
>>
>https://www.gamingonlinux.com/2020/04/distro-news-ubuntu-2004-focal-fossa-ubuntu-mate-and-other-flavours-released/page=5
>> Certainly, I've seen gimp-help suggestions to use flatpack for
>> python2 scripting in ubuntu because of the absence of python2.
>
>I just found out that Mint 20 has python2 and python3, but no python.
>
>   -- Bruce
>-- 
>http://lists.linuxfromscratch.org/listinfo/blfs-dev
>FAQ: http://www.linuxfromscratch.org/blfs/faq.html
>Unsubscribe: See the above information page

Short answer, if it still has '/usr/bin/env python' in the shebang, and it 
doesn't work with with both python2 and python3, then it's abandonware. They've 
had nine years to fix it and haven't.

After reading PEP 393 for the umpteenth time, I'm now more partial to just 
dropping the symlink all together and making shebang lines explicit as was done 
with Ubuntu and its variants. PEP 393 really ultimately left it up to the 
distro, but my reading of it suggests this is the best path forward. The user 
can't expect to get an interpreter with no symlink if they type 'python' at the 
cli, but that makes any errors outside of BLFS rather explicit, as opposed to 
complaining about print() syntax (or worse). We can suggest adding an alias for 
python to python3 in the user's .bashrc if people complain.

We can try and help out, hit it with 2to3 and follow the prompts, or better, 
introduce sixer, and see if it works as expected and submit upstream. But that 
introduces six and sixer as more dependencies upstream, sixer at least, 
requires itself on target for whatever version of python matches the symlink 
because it'll replace python2 syntax with it's own mostly compatible variant 
(ex: sixer.iteritems(...) rather than items(...) as a replacement for 
iteritems(...)), but it does a better job than 2to3 or others. Introducing 
future has it's own quirks as well, and like 2to3, requires some knowledge of 
python and manual edits.

--DJ

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to