[Python-ideas] Migration of /usr/bin/python to python3

Chris Barker chris.barker at noaa.gov
Wed Mar 11 23:54:04 CET 2015


On Wed, Mar 11, 2015 at 3:41 PM, Gregory P. Smith <greg at krypto.org> wrote:

> I think /usr/bin/env is a bad idea to promote. It changes from an explicit
> designation of what you need in order to execute to something being derived
> from the users $PATH.  It is *less specific* than /usr/bin/python. For some
> people that is the goal, but I discourage it.
>

I don't think the goal is specificity, or lack there of, but a shift in
control:

Who controls where python is installed?

If you put an explicit full path on the #! line, then the script author
controls which python is used, AND where it must be installed.

If you put /usr/bin env on the #! line, then the script author is saying
'use python", and the script user can have python installed anywhere they
want, and can use PATH to tell everything what the default it.

I think that _should_ be encouraged -- but ideally with some versioning:

#!/usr/bin/env python2

or even:

#!/usr/bin/env python3.4

If any of you remember what a pain it was when RedHat installed system
tools with (I think):

!#/usr/bin/env python

You'll know what a nightmare that was -- you could not upgrade the
'default" python without breaking stuff.

So system tools should probably use the full specific path -- the script is
tied closely to the environment. But if they had at least put a version in
there, it would have worked fine:

#!/usr/bin/env python1.5

These days, I try to use distutils or setuptools to install scripts, and
they can do the right thing to use the correct python to start up anyway...

-CHB



-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150311/8a57da62/attachment.html>


More information about the Python-ideas mailing list