[docs] [issue10318] "make altinstall" installs many files with incorrect shebangs
report at bugs.python.org
Wed Nov 23 01:08:58 CET 2011
Nick Coghlan <ncoghlan at gmail.com> added the comment:
Hmm, my initial reaction is that that specific wording is stronger than I had in mind - there's nothing really wrong with having a shebang line and execute bit set on a top level module and symlinking it from /usr/bin. The problem is that we're doing those things for modules that we *don't* install as binaries, and that's silly (particularly when the shebang lines are wrong on altinstall). However, that concern can specifically by addressed by moving the new section down to be a subheading in the "Rules that apply only to the standard library" section.
I'd also mention the justification that this is due to such shebang lines creating a maintenance problem for handling parallel installations of different Python versions.
Also, with PEP 397 a viable candidate, we may as well make the wording OS neutral. Something like:
Executable Files and Shebang Lines
Standard library modules (including test modules) should not be
flagged as executable files nor contain a shebang line.
Including shebang lines in standard library modules is an issue, as
they create a maintenance problem when multiple versions of Python
are installed in parallel. The easiest way to avoid accidentally
invoking the wrong version of Python is to simply not include such
lines at all.
If a module provides command-line functionality, it can be used with
``python -m module`` or via a small script (in a different file) that
imports the module and calls one of its functions (e.g. the ``pydoc``
script imports the ``pydoc`` module and calls ``pydoc.cli()``).
Any installed scripts should use a shebang line of the form::
where ``X.Y`` is the specific Python version being installed.
Updating these lines to the correct Python version should be
automated, either as part of the installation process or as part
of the version update process (see PEP 101).
The PEP 8 update should be run by the wider audience of python-dev before it gets committed, though.
Python tracker <report at bugs.python.org>
More information about the docs