[arch-general] a plea for python 2

Evan Martin martine at danga.com
Wed Dec 14 17:24:12 EST 2011


Hello,

I'm a recent Arch user, a refugee from Ubuntu.  I was attracted to
Arch because I was tired of Ubuntu forcing their new software on me --
it seemed the Arch way was to allow you to use bleeding edge if you
wanted it, but to not fork upstream.

So it was with some surprise that I discovered that Arch made
/usr/bin/python point to something other than Python 2.  This differs
from every other system (not only other Linuxes, but also [as I
learned from bug reports I received] OS X and even python.exe on
Windows).

I appreciate that y'all want to use the bleeding edge, and it
completely consistent with my understanding of Arch that you would
only provide Python 3 by default as well as write your system scripts
use Python 3.  (I write this mail with some trepidation as I fear a
response like "STFU noob Arch is bleeding edge", which is
emphatically not a response to the issue I'm actually raising.)

What I don't understand is why you're manually patching upstream
software to rewrite references from /usr/bin/python to
/usr/bin/python2.  This sort of forking is exactly the sort of
divergence (like how Ubuntu modified their GTK to add their own
specific hooks) that I was fleeing from when I came to Arch.  :(
You can see in the references below that it appears this is
contrary to how upstream thinks it should work.

It means that I can't download any random project (such as Chromium)
and build it without first applying Arch-specific patches.  And
upstreams like Chromium can't change to support Arch's divergence
without breaking their code on non-Arch systems.

As a software developer, I am now getting contacted by users where my
software doesn't work on Arch.  I even applied a patch submitted by an
Arch user to make my code use "python2" only to discover it broke my
software on Mac and Windows.

So my questions for you are

1) Is it intentional that I am unable to use software from upstream
   like Django unmodified?  Am I expected to only install software
   from the Arch repositories, where it has been patched by Arch devs
   to work on Arch? (See below for more on Django.)

2) Should I change the software I write to attempt to detect when I'm
   on an Arch system and adjust scripts/etc. accordingly? (I can't just
   "fix it" because there is no /usr/bin/python2 on existing systems like
   Macs.)

Both of those seem pretty unsatisfactory.  Help!



Here are some additional references, if they help you any.

- Upstream Python dev believes that code that uses /usr/bin/python
  when it wanted Python 3 is wrong:
  http://mail.python.org/pipermail/python-dev/2009-April/088864.html

- According to Google's Code search, there are likely around 80,000
  existing Python scripts that are broken by this change.
  (Note that searching for /usr/bin/python[^23] doesn't work,
  you have to search for /usr/bin/python then subtract out the ones
  ending in 2 or 3:
   http://codesearch.google.com/#search/&q=/usr/bin/python%20lang:python&type=cs
   http://codesearch.google.com/#search/&q=/usr/bin/python%5B23%5D%20lang:python&type=cs
  )

- As a random example, here's a script from the Django project (which
  I chose for this mail as an example of a high-profile Python
  program) that uses 'python' when it means Python 2:
    https://code.djangoproject.com/svn/django/trunk/tests/runtests.py

  Here's their statement on Python 3:
    https://docs.djangoproject.com/en/dev/faq/install/#can-i-use-django-with-python-3

  And here's the PKGBUILD, which patches around this:
    http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/django

- Here's a project of mine where on AUR they've attempted to patch
  around the python/python2 thing in the PKGBUILD:
    http://aur.archlinux.org/packages/ni/ninja-git/PKGBUILD
  However, the patch is not sufficient, which lead to another bug report.

- A Python developer discusses how Python3 is very different from Python2,
  making it very difficult as a developer to support both:
    http://lucumr.pocoo.org/2011/12/7/thoughts-on-python3/


More information about the arch-general mailing list