The magnitude of the migration to Python 3, illustrated

June 29, 2012

I was just reading Nick Coghlan's Python 3 Q & A. and ran across this:

Support in enterprise Linux distributions is also a key point for uptake of Python 3. Canonical have already shipped a supported version (Python 3.2 in Ubuntu 12.04 LTS) with a stated goal of eliminating Python 2 from the live install CD for 12.10. A Python 3 stack has existed in Fedora since Fedora 13 and has been growing over time, but Red Hat has not made any public statements regarding the possible inclusion of that stack in a future version of RHEL.

To give some other perspectives on the transition, I'll note that Ubuntu already has a tentative plan to move their Python 2 stack into the community supported universe repositories and only officially support Python 3 for their 14.04 release.

(It should be noted here that based on the release schedule, Ubuntu 14.04 is currently scheduled for April 2014, with a feature freeze probably happening around six months earlier.)

I'm afraid that my reaction to this involves a certain amount of grim laughter. To explain why, let's talk about the magnitude of the effort involved in making this sort of transition for a Linux distribution; in particular, I am going to look at Ubuntu 12.04 and Fedora 17.

On an Ubuntu 12.04 machine more or less configured as a desktop and with a decent package selection installed, there are around 240 executables installed that use Python 2, from around 90 different Ubuntu packages, with over a hundred programs that are directly run by people (ie are in /bin, /sbin, /usr/bin, or /usr/sbin). Now some of these are part of Python or otherwise tied to it but there are fair number that are not, including some large and important packages like Mercurial.

On my Fedora 17 workstation (which has quite a number of packages) there are around 310 executables installed that use Python 2, from over 130 packages; over 200 programs are in /usr/bin or /usr/sbin. Again there are large and significant packages involved, including a fair number of important system management packages (especially yum, in many ways the core package management system for Fedora).

But the bad news is not done yet. On both Ubuntu 12.04 and Fedora 17, there are no non-Python packages that use Python 3. Zero. Zip. None. The only Python programs that use Python 3 come from Python 3 itself. And if you want another bit of bad news, neither Fedora 17 nor Ubuntu 12.04 even install Python 3 by default. New, stock installed systems are Python 2 only. This is not a migration that is in progress; this is a migration that hasn't even started yet.

(By the way, as far as I am concerned this means that Ubuntu 12.04 can't be fairly described as 'shipping Python 3', merely as having it available.)

Sidebar: why not installing Python 3 by default matters

Imagine a new Python user on a Fedora or Ubuntu system. The most convenient version of Python for them to start using is one that's already on their system (especially the one that's called 'python'). The more you needs to know and the more you need to do to use another version, the less likely you are to use it or try it out. Right now, as a new Python user you have to go out of your way to know about Python 3, install Python 3, and then use it. By contrast you can use Python 2 by just typing 'python'.

(Among other things this affects people who are casually curous about how things are in Python 3. Casual curiosity doesn't survive work.)

Or in short: installing Python 3 by default makes it enticing. Not installing Python 3 by default makes it unenticing.

Comments on this page:

From at 2012-06-29 18:26:39:

The "default" is a non-issue on Fedora due to the packaging supremacy. If you select a package that uses Python 3, then Python 3 gets installed. It's that simple. So, I disagree with the sidebar. And by the way, I am quite sure that F18 installs Python 3 in various minimal installs (when I tab-complete /usr/lib/python, I have to hit '2' now). Not that it matters any, as I outlined.

The biggest cost is the actual transition: writing the software that works with Python 3. It is not as transparent as they promise.

By cks at 2012-06-30 01:27:01:

I agree that Fedora (and everyone) has the dependency situation solved and so Python 3 will get auto-installed if anything actually needs it. What I'm concerned about is not (properly packaged) programs but instead potential or starting Python programmers (that's what I meant by my unclear use of 'user'). If Python 3 is not already installed on these people's systems, I think that most of them will never even try it; they will wind up as Python 2 programmers by default. I further think that this is a bad thing for any contemplated Python 2 to Python 3 transition (in a transition situation, you want new people to start out using the new version instead of drifting into the old one by default).

I'm glad to hear your news about Fedora 18. Maybe something similar will happen in the next Ubuntu non-LTS release (although it doesn't help places that only use LTS releases).

Written on 29 June 2012.
« More about my issues with DTrace's language
What Linux distributions should do to help their Python 3 transitions »

Page tools: View Source, View Normal, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Fri Jun 29 15:51:53 2012
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.