[Python-Dev] Support the /usr/bin/python2 symlink upstream

Toshio Kuratomi a.badger at gmail.com
Fri Mar 4 05:37:07 CET 2011


On Thu, Mar 03, 2011 at 09:46:23PM -0500, Barry Warsaw wrote:
> On Mar 03, 2011, at 09:08 AM, Toshio Kuratomi wrote:
> 
> >Thinking outside of the box, I can think of something that would satisfy
> >your requirements but I don't know how appropriate it is for upstream python
> >to ship with.  Stop shipping /usr/bin/python.  Ship "python" in an alternate
> >location like $LIBEXECDIR/python2.7/bin (I think this would be
> >/usr/lib/python2.7/bin on Debian and /usr/libexec/python2.7/bin on Fedora
> >which would both be appropriate) then configure which python version is
> >invoked by the user typing "python" by configuring PATH (a shell alias might
> >also work).  You could configure this with environment-modules[1]_ if Debian
> >supports using that in packaging.
> 
> I wonder if Debian's alternatives system would be appropriate for this?
> 
> http://wiki.debian.org/DebianAlternatives
> 


No, alternatives is really only useful for a very small class of problems
[1]_ and [2]_.  For this discussion there's an additional problem which is
that alternatives works by creating symlinks.  Piotr Ożarowski wants to make
/usr/bin/python not exist so that scripts would have to use either
/usr/bin/python3 or /usr/bin/python2.  If alternatives places a symlink
there, it defeats the purpose of avoiding that path in the package itself.

I will note, though that scripts that have /usr/bin/env and take the route
of setting the PATH would still fall victim to this.  I think that
environment-modules can also set up aliases.  If so, that wouldbe better
than setting PATH for finding and removing "python" without a version in
scripts.

One further note on this since one of the other messages here had
a reference to this that kinda rains on this parade:
http://refspecs.linux-foundation.org/LSB_4.1.0/LSB-Languages/LSB-Languages/pylocation.html

The LSB is a standard that Linux distributions may or may not follow --
unlike the FHS, the LSB goes beyond encoding what most distros already do to
things that they think people should do.  For instance, Debian derivatives
might find the software installation section of LSB[3]_ to be a bit... hard
to swallow.  Fedora provides a package which aims to make a fedora system
lsb compliant but doesn't install it by default since it drags in gobs of
packages that are otherwise not necessary on many systems.

However, it does specify /usr/bin/python so getting rid of /usr/bin/python
at the Linux distribution level might not reach universal aclaim.  A united
front from upstream python through the python package maintainers on the
Linux distros would probably be needed to get people thinking about making
this change... and we still would likely have the ability to add
/usr/bin/python back onto a system (for instance, as part of that lsb
package I mentioned earlier.)

.. [1]:
https://fedoraproject.org/wiki/Packaging:EnvironmentModules#Introduction
.. [2]:
http://fedoraproject.org/wiki/Packaging:Alternatives#Recommended_usage

.. [3]:
http://refspecs.linux-foundation.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/swinstall.html

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110303/417dcf9c/attachment.pgp>


More information about the Python-Dev mailing list