[docs] [issue10318] "make altinstall" installs many files with incorrect shebangs

Éric Araujo report at bugs.python.org
Sun Nov 20 15:20:19 CET 2011

Éric Araujo <merwok at netwok.org> added the comment:

The patches I’ve discussed and committed were actually peripheral.  The original bug reported here is that shebangs shouldn’t use “/usr/bin/env python” with an altinstall installation, as in that case you’re not creating a python (or python3) binary but a pythonx.y, so the shebangs should refer to that exact x.y versions.

The few scripts from Tools/scripts (idle, pydoc, 2to3, python-config) are installed with an x.y suffix and hard-code the Python version and location at build time, by using distutils.  (That’s why Nick reports the only matches for “3.2” found by grep are in the build/scripts directory.)

The stdlib modules do use “/usr/bin/env python[3]”.  I see various ways to handle that:
a) Reject the bug as works for me: these are stdlib modules, not scripts, they can be imported or executed with -m, they’re not symlinked (by us) from anywhere so the bug, while technically valid, has no real effect.

b) Further complicate the build/install machinery to update shebangs in altinstall mode.

c) Remove useless shebangs and execute bit in the stdlib.

My preference is to do c) for 3.3 and nothing for the stable versions.

(About wrongly using python in Python 3 docs: I’ll open another bug for that).


Python tracker <report at bugs.python.org>

More information about the docs mailing list