[Python-Dev] [PATCH] Handling of scripts (original) (raw)

[Python-Dev] [PATCH] Handling of scripts / substitution of python executable path

Barry Warsaw barry at python.org
Fri Feb 23 20:26:52 CET 2007


-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

On Feb 23, 2007, at 9:55 AM, Jean-Paul Calderone wrote:

On Fri, 23 Feb 2007 15:36:50 +0100, Hans Meine <meine at informatik.uni-hamburg.de> wrote:

Hi!

[snip - distutils should leave #!/usr/bin/env python alone] Comments? (I first posted this to distutils-sig but was told that distutils is a bit neglected there, so I decided to try to push these simple patches in via python-dev.) How about a distutils installation command line option to tell it to use this behavior? People with unusual environments can select it.

This would be best I think. There's a related problem here. Many
operating systems (e.g. various Linux distros) provide system scripts
written in Python and they incorrectly use /usr/bin/env. The problem
is that if you have your own version of Python earlier in your $PATH,
you can break these scripts. This happens when say your /usr/local/ bin/python doesn't have the packages that your /usr/bin/python
expects. I've hit this quite a few times on Gentoo for example. In
these cases, you really do want the #! line to point to the OS's
version of Python rather than whatever random installation is on your
$PATH.

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin)

iQCVAwUBRd8//XEjvBPtnXfVAQLZKQP+NvcjMIT4tCZtOIPWo8Kj1JMp5iX0Nqib BBXPgDtncJ6VvITclbYLAmitPhwkDddHXgNIHoj2lY9HJildfOkDQxVpDRTvrEvd hlIW4z7S6SmlrvxJYSB2jGSpkNkVRo8UpZKsmU0BWFBE9t6Tnw+ofItuKIF1TlWS unSo4LceXFo= =wiLG -----END PGP SIGNATURE-----



More information about the Python-Dev mailing list