[Python-Dev] Another update for PEP 394 -- The "python" Command on Unix-Like Systems

Chris Barker chris.barker at noaa.gov
Tue Feb 26 17:43:24 EST 2019

On Tue, Feb 26, 2019 at 9:58 AM Barry Warsaw <barry at python.org> wrote:

> I see this question as having several parts, and the conflation of them is
> part of the reason why the unversioned `python` command is so problematic.
> Python is used for:
> * OS functionality
> * to run applications that aren’t critical to the OS but are delivered on
> the OS
> * as the entry point to the interactive interpreter
> * to run applications written and deployed on the OS but completely
> outside of it
> For OS functionality, there should probably be a separate command not
> conflated with /usr/bin/python.  The OS can make any adjustments it needs,
> calling it `spython` (as I think Nick once suggested), or whatever.  Nobody
> but OS maintainers cares what this is called or what version of Python it
> exposes.

I'm not sure that's necessary at all -- the OS should simply use an
unambiguous path!

I was a RedHat user way back when when in the midst of the python1.5 => 2.0

RedHat had a bunch of system scripts that had (I think):

#!/usr/bin/env python

In them (or maybe /usr/bin/python, but I'm pretty sure it was the env
version). In any case, when you installed python2 (to local) your system
scripts would ll break (even if they were python2 compatible, there wasn't
a lot of difference, but RedHat also depended on extra packages...)

So what we had to do was install python 2, remove the "python" command that
came with it, and use "python2" in all our scripts.

This was simply broken, and it was RedHat's fault. If they had used:


in their shebang lines, there would have been no problem. And users could
still use the system python1.5 if they wanted, or install an update, or

My pint is:

Any OS that ships OS scripts that expect "python" to be a specific version
(or worse, a specific install) is broken.

Some distros are going to ignore the PEP anyway, so there is no harm (and
some good) in specifying in teh PEP the way we think it SHOULD be done, and
then see what happens -- we don't need to make the PEP match current



Christopher Barker, Ph.D.

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-dev/attachments/20190226/faf9fcd5/attachment.html>

More information about the Python-Dev mailing list