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

Barry Warsaw barry at python.org
Tue Feb 26 12:54:47 EST 2019


> There haven't been many new ideas since this summary – mostly it was explaining and re-hashing what's been mentioned before.

Thanks for the summary Petr.

Here’s another way to think about the problem.  I know Nick and I have talked about this before, but I don’t think any distros have actually done this, though I’ve been out of that business a while now so correct me if I’m wrong.

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

Which `python` are we trying to change?  All of them?

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 strongly believe that (eventually) the interactive interpreter command should be /usr/bin/python and that this should point to Python 3, since this provides the best experience for beginners, dabblers, etc.

So what about the other two use cases?  Well, for applications packages within the OS but aren’t critical to it, I think they should always use the versioned shebang, never the unversioned shebang.  Distros can control this, so that transition should be easier.

The tricky part then seems to me what to do for 3rd parties which are using the distro Python in their shebangs?  Nobody sees their code but them, and changing the shebang out from under them could cause their code to break.  But don’t they already take lots of precautions and planning for any OS upgrade?  Changing the shebang for Python 2 would be just one of the things they’d have to worry about in an OS upgrade.

I don’t know whether this analysis is complete or correct, but perhaps it helps inform a way forward on PEP 394.

Cheers,
-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://mail.python.org/pipermail/python-dev/attachments/20190226/00dca318/attachment.sig>


More information about the Python-Dev mailing list