[Python-Dev] Python-3 transition in Arch Linux

Nick Coghlan ncoghlan at gmail.com
Thu Nov 4 14:33:38 CET 2010


On Thu, Nov 4, 2010 at 2:44 PM, Allan McRae <allan at archlinux.org> wrote:
> The second case was particularly interesting.  These software would change
> some of their #! to point at the python2 symlink and leave the rest pointing
> at python.  Note that python-2.7 itself falls into this category as many
> files in /usr/lib/python2.7 still have "#!/usr/bin/env python" even when
> installed with "make altinstall".  I can not remember the exact details, but
> I recall that some of these files were installed with executable permissions
> which would be bad, but I need to look into this again now things have
> calmed down...
>
> The packages that did not auto-detect and work with /usr/bin/python2 or
> /usr/bin/python2.7 mostly required a sed of their shebangs or a patch to any
> hardcoded /usr/bin/python paths so were easily fixed.

A very interesting exercise, indeed - especially the observation
regarding software (including python itself) that supports
installation under alternate names, but doesn't subsequently ensure
use of that name in its shebang lines.

I just did a quick grep of Lib in my py3k directory, and it looks like
cgi.py is incorrectly set to use "/usr/local/bin/python", while the
other files with shebang lines are set to "/usr/bin/env python3" as
expected.

Tools also had a few discrepancies:
  scripts/2to3.py: /usr/bin/env python (necessary, I think - I believe
2to3 is a 2.x only program)
  scripts/gprof2html.py: /usr/bin/env python32.3 (Huh? Automated
correction gone wrong, perhaps?)
  scripts/reindent-rst.py: /usr/bin/env python (probably incorrect)
  pybench: /usr/bin/env python (not sure - has pybench been forward
ported on the 3.x branch?)
  world: /usr/bin/env python (I have no idea what this script is even for)

(Note that these examples are a matter of simply respecting the
*default* install location for python3, without even getting into
questions of altinstall or configured installation locations)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list