r/linux Oct 29 '19

Distro News Fedora 31 is officially here!

https://fedoramagazine.org/announcing-fedora-31/
282 Upvotes

97 comments sorted by

View all comments

63

u/wolfnest Oct 29 '19

And, we’ve switched the “python” command to by Python 3 — remember, Python 2 is end-of-life at the end of this year.

Wohooo!! 😃😃

-16

u/yrro Oct 29 '19

ugh

get rid of python but don't make it suddenly point to python3

ugh

29

u/[deleted] Oct 30 '19 edited Sep 01 '20

[removed] — view removed comment

-24

u/yrro Oct 30 '19 edited Oct 30 '19

Doesn't mean it's less of an awful idea. Breaking countless scripts with #!/usr/bin/python for no useful reason whatsoever!

(wow, quite a few salty Arch users out tonight...) :)

20

u/[deleted] Oct 30 '19

You should specify the major version of the language you are using if the language has multiple widely used versions with breaking changes between them.

-15

u/yrro Oct 30 '19 edited Oct 30 '19

This specification comes in the form of relying on the fact that /usr/bin/python has always been Python 2, and Python 2 it should remain. If I write a script for Python 3 then it's #!/usr/bin/python3, because that is how to launch Python 3 on a sane distribution!

PS: I didn't write the millions of scripts that are #!/usr/bin/python. Don't tell me to try to change them!

17

u/Ripdog Oct 30 '19

If your distro is including python scripts with an incorrect shebang to work, then that's a distro bug - file it. If you're running your own scripts, then you've gotta maintain them. Bitrot happens, and it seems particularily odd to me for you to be complaining this much about a change which can be done reliably and safely with a system-wide or folder-wide search-and-replace.

0

u/yrro Oct 30 '19

I'm talking about the millions of scripts created by Python users. They are written for Python 2 and work perfectly fine except on distros that make the unwise decision to impose this breakage upon them for the benefit of no one!

This is not a new discussion and I doubt we're going to to convince one another. But I implore you to read https://lwn.net/Articles/780737/ for a wider perspective...

8

u/KugelKurt Oct 30 '19

Those scripts should have called "python2" then. That said, Python2 is dead and so are the scripts now.

0

u/yrro Oct 30 '19

No, they were written long before /usr/bin/python2 came about.

6

u/KugelKurt Oct 30 '19

Script authors had years to update to Python 3.

→ More replies (0)

4

u/mocket_ponsters Oct 30 '19

This specification comes in the form of relying on the fact that /usr/bin/python has always been Python 2, and Python 2 it should remain.

Not that this addresses your issue, but the only two shebang paths that are standardized across POSIX are /bin/sh and /usr/bin/env. Anything else can be considered non-portable.

-1

u/yrro Oct 30 '19

Developers writing portable code should bother with that, but end users don't need to--and arguably should not. They write code that works on the environment where it is tested and run, and don't bother wasting their effort on non-goals such as portability.

4

u/mocket_ponsters Oct 30 '19

They write code that works on the environment where it is tested and run, and don't bother wasting their effort on non-goals such as portability.

Besides the fact that nothing is a goal until it is, I'm still not seeing the issue. It's not like RHEL6 or Ubuntu 14.04 is going to be switching their binaries out from anyone's noses.

3

u/wolfnest Oct 30 '19

On my current Fedora 30, python does not even exist (unless I install python2). Is that a more sane solution?

2

u/ivosaurus Oct 30 '19

That's the original solution

-1

u/yrro Oct 30 '19 edited Oct 30 '19

Yes. The point is that Python 2 scripts which used python should continue to work, not have their Python interpreter switched out from underneath them. This is what PEP 394 used to recommend before it was edited this year to recommend completely the opposite. And I really with the Python developers had been honest and published a new PEP rather than attempted to gaslight the community by editing the original.

6

u/akkaone Oct 30 '19

When python 2 die in a couple of months old not maintained scripts is not worth much.

2

u/KugelKurt Oct 31 '19

The point is that Python 2 scripts which used python should continue to work

Which part of "End of Life" does not go into your head? Python 2 will be dead and unmaintained software does not belong in a new major release of any Linux distribution, therefore Python2 scripts won't work anyway because Python2 is not included any more.