Hacker News new | ask | show | jobs
by AsyncAwait 3421 days ago
> My Python 2 scripts on Github start with "#!/usr/bin/python", as do many others. All of these broke for you as an Arch user.

So you made certain assumptions. Have you made your scripts use python2, which is safer anyway, everything would've been fine, don't blame Arch for your incorrect assumptions.

1 comments

No. Before Arch made their change, that /usr/bin/python is Python 2 was the only possible assumption that could be made. No distribution shipped /usr/bin/python2 at that time. There was no need, because /usr/bin/python was always Python 2.

It was only because of what Arch unilaterally did that forced the community to start providing a /usr/bin/python2. Before that, /usr/bin/python2 did not commonly exist at all.

> It was only because of what Arch unilaterally did

Arch is a bleeding-edge, latest software kind of distribution. They did not made the decision 'unilaterally'. They made the decision to ship the latest software for their own distribution, as they always do. It may have proven that a lot of software is extremely poor/inflexible, (i.e. rests on weak assumptions), but I am glad Arch moved forward as that showed their resolve to move technology forward even in the face of a lot of pressure from outside groups.

I just think that instead of blaming Arch, try to make your scripts more robust, i.e. loop on all 'python*' binaries in /usr/bin and use the first one whose --version gives you '2.x' instead of relying on /usr/bin/python being python 2 when the latest version is 3 and Arch is known to ship latest software.

> They made the decision to ship the latest software for their own distribution, as they always do.

As did all the other distributions. Shipping Python 3 is not the issue here. Breaking compatibility with all existing Python 2 scripts is what they did. The two are not mutually exclusive.

> I just think that instead of blaming Arch, try to make your scripts more robust, i.e. loop on all 'python<glob>' binaries in /usr/bin...

You want me to do that in a shebang line? No. That'd be crazy.

> ...when the latest version is 3 and Arch is known to ship latest software.

See https://en.wikipedia.org/wiki/Application_binary_interface. What Arch did was break the ABI of what /usr/bin/python means, breaking all scripts that relied on that ABI. Shipping the latest software is orthogonal to this. The rest of the world ships the latest software too, but without breaking ABI.

The rest of the world explicitly doesn't ship the latest software, check the kernel version in the latest version of ubuntu vs arch, same for GNOME etc. Ubuntu did not even had python3 installed for a long time by default, you had to apt-get it

The ABI was never documented and at best a convention-enforced one.

> Ubuntu did not even had python3 installed for a long time by default, you had to apt-get it

I call your straw man. As I've already repeatedly said, the issue is about breaking ABI, not about what software distributions shipped, nor what they had installed by default. Making /usr/bin/python point to Python 3 has nothing to do with what distributions shipped, nor what they had installed by default. The issues are completely orthogonal. Stop trying to pretend otherwise.

> The ABI was never documented and at best a convention-enforced one.

Upstream shipped build systems that put Python 2 in /usr/bin/python, and Python 3 in /usr/bin/python3. That's about as good a definition of ABI as one gets in the free software world. Arch deliberately patched the ABI. You can try to argue that their decision to do so was correct, even though I disagree. You cannot argue that they didn't know they were changing an ABI when they patched the ABI.

> call your straw man. As I've already repeatedly said, the issue is about breaking ABI, not about what software distributions shipped,

But it is very much about that. Arch ships latest software, Python 3 is the latest python, python 2 is not. Ubuntu, Debian etc. ship old, outdated software regularly, Arch doesn't.

Because the latest python was python 3, /usr/bin/python pointed there. The other distributions explicitly decided not to ship the latest python.

Prior to Arch making the switch, the 'ABI' was not /usr/bin/python points to python 2, it simply pointed to the latest python release, which on most systems happened to be python 2, because they did not even ship python 3 at all at the time.

You may not agree with the decision, but to pretend like it was "out of nowhere" is unhelpful.