[Distutils] Shebang lines, /usr/bin/python, and PEP394

Barry Warsaw barry at python.org
Fri Jul 26 21:32:00 CEST 2013


On Jul 26, 2013, at 09:58 PM, Nick Coghlan wrote:

>Not everybody uses generated script wrappers, though - if there is a
>hardcoded "/usr/bin/env python" or "/usr/bin/python" in a shebang
>line, the Python build tools won't touch it. There's also a whole lot
>of software that isn't packaged at all - it's sitting around in user
>and admin home directories, or maybe in a shared directory on a file
>server or even in a private source control repo.

I actually think installing a script via setuptools should rewrite shebangs
even in the case of /usr/bin/env.

I love `#!/usr/bin/env python` *for development* but I really think its a bad
thing to have for installed scripts.  Certainly, for distro installed scripts,
it's (usually) terrible.  I think virtualenv installs are generally in the
same boat though - if you're installing a script into a virtualenv, it's
better to rewrite the shebang to use the executable that was used to install
it.

-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130726/462ecf1c/attachment.pgp>


More information about the Distutils-SIG mailing list