News for hackers. Stuff that matters.
Re:Python 2 Removed from Debian by qwertox on Tuesday January 03, 2023 @03:06AM (#34229049)
I liked how Canonical did it: the command `python` would not execute, you have to use `python3` explicitly. This means that your old Python 2 code would not get executed if it were triggered by some shell script via the `python` command, you'd have to fix the shell script and become aware that you still need to migrate the Python script.
Re:Python 2 Removed from Debian by bayindirh on Tuesday January 03, 2023 @03:11AM (#34229083)
This is also how Debian did it, too. Actually it's probably propagated from Debian Unstable to Ubuntu.

You need to install either "python-is-python2" or "python-is-python3" packages to get proper system-wide symlinks. Also, it was strictly verboten to give either of two packages as dependencies to workaround migration procedures.

Debian Testing doesn't have Python2 at least for a year now.

Re:Python 2 Removed from Debian by ilyt on Tuesday January 03, 2023 @05:48AM (#34229976)
I've upgraded debian thru the ages and /usr/bin/python defaulted to python2. Didn't need to install anything for that to happen, maybe if you installed debian from scratch

Another mistake in Py3 migration was keeping the interpreter name as python so when you had it in path you had a choice of new stuff breaking or old stuff breaking

Re:Python 2 Removed from Debian by bayindirh on Tuesday January 03, 2023 @06:24AM (#34230210)
> I've upgraded debian thru the ages and /usr/bin/python defaulted to python2

It was, in the past.

When python2.7 deprecated and removed in Debian testing, python ceased to exist as a command. You need to install these packages (python-is-python{2,3}) to get the python command and point to the correct interpreter you like.

This behavior is consistent in two Debian testing systems, installed 6 and 9 years ago, respectively.

Re:Python 2 Removed from Debian by orangepanda on Tuesday January 03, 2023 @03:11AM (#34229085)
I dont know python. Does python3 have different behaviour than python2 on the same code, beyond just crashing?
Re:Python 2 Removed from Debian by mau on Tuesday January 03, 2023 @03:36AM (#34229245)
You can write code that runs in both interpreters. Same syntax can have different behavior.

I guess nowadays, as the py2 compatibility is a thing of the past, most programs would crash when using that interpreter version.

Re:Python 2 Removed from Debian by Tom4hawk on Tuesday January 03, 2023 @03:33AM (#34229216)
Integer division