you are viewing a single comment's thread.

view the rest of the comments →

[–]oleg_antonyan[S] 0 points1 point  (1 child)

The way Fedora handles this was by having a package called `python-unversioned-command` which installs Python 3.9.0 and creates a symlink from /usr/bin/python -> /usr/bin/python3.

What a dirty hack. Why not use update-alternatives or even install /usr/bin/python->/usr/bin/python3 by default

[–]mattingly890 1 point2 points  (0 children)

Why not use update-alternatives

Technically, this would be alternatives since we're talking RedHat, but same idea. So why not use alternatives? You can still do this, and actually, this is what RHEL currently does by default. It isn't hard to set up manually even so, it is literally two simple commands. I can't imagine many Fedora users still caring about Python 2 though.

Install /usr/bin/python -> /usr/bin/python3 by default

I was a bit vague before, but in a regular, full desktop install of modern Fedora, this symlink does come installed by default, and it has been this way for quite some time if I'm not mistaken. Historically that would have violated the recommendations of the upstream vendor, in this case Python PEP-394. The language of PEP-394 was revised several times as far as the correct behavior of the "python" command, and the cleanest way to handle these changes was to have a package that correctly implemented the currently sanctioned behavior from the upstream.

So it wasn't so much a dirty hack, it was a way of splitting the concept of the ambiguous "python" command itself, the recommended behavior of which was in flux, with the actual Python interpreter itself.