This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients allan, belopolsky, benjamin.peterson, docs@python, eric.araujo, eric.smith, ezio.melotti, georg.brandl, jcea, ncoghlan, ned.deily, orsenthil, python-dev, r.david.murray
Date 2011-11-23.00:08:57
SpamBayes Score 0.0
Marked as misclassified No
Message-id <1322006938.72.0.537914542127.issue10318@psf.upfronthosting.co.za>
In-reply-to
Content
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::

        #!/usr/bin/env pythonX.Y

   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.
History
Date User Action Args
2011-11-23 00:08:58ncoghlansetrecipients: + ncoghlan, georg.brandl, jcea, belopolsky, orsenthil, eric.smith, benjamin.peterson, ned.deily, ezio.melotti, eric.araujo, r.david.murray, docs@python, allan, python-dev
2011-11-23 00:08:58ncoghlansetmessageid: <1322006938.72.0.537914542127.issue10318@psf.upfronthosting.co.za>
2011-11-23 00:08:58ncoghlanlinkissue10318 messages
2011-11-23 00:08:57ncoghlancreate