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

Ned Deily nad at acm.org
Tue Mar 8 11:34:19 CET 2011


After a little investigation, I think what is currently proposed in the 
PEP is fine for OS X and other systems which use the Unix makefile 
altinstall and install targets, as far as it goes.  However, for 
completeness, I think the PEP should also cover (most of) the other 
files that are installed in the "bin" directory besides python; those 
are idle, pydoc, and python-config, and 2to3.  To allow a clean eventual 
transition to Python 3 as the default, 2.7.2 should be changed to 
install the new hard links: python2, idle2, pydoc2, and python2-config.  

Currently, there are no overlapping filenames in the bin directory 
between Py2 and Py3 installs except for 2to3.  2to3 is a bit of a 
special case since it is common between Py2 and Py3; however the version 
of 2to3 itself differs between releases.  As of now, if the standard 
Makefiles are used, the user will get 2to3 from the Python release for 
which a "make install" (or for Python 2.x, a "make altinstall" as well) 
has most recently been executed.  That might not be the most recent 
version of 2to3, say, if an older Py2 release is installed after a newer 
Py3 one.  That's not good practice.  But that is also outside the scope 
of the PEP.

What is currently added to the installation bin directory for 2.7 and 
3.2 is summarized in the table below followed by the proposed changes.  
Note, the bin directory is typically /usr/bin on Unix-y systems; for Mac 
OS X framework builds, each Python minor version has its own bin 
directory within the same base Python framework.

  2.7        3.2
--- ---    --- ---
alt ins    alt ins
--- ---    --- ---
 Y   Y          Y   2to3
            Y   Y   2to3-3.2
                Y   2to3 (symlink to 2to3-3.2)
 Y   Y              idle
            Y   Y   idle3.2
                Y   idle3 (symlink to idle3.2)
 Y   Y              pydoc
            Y   Y   pydoc3.2
                Y   pydoc3 (symlink to pydoc3.2)
     Y              python (hardlink to python2.7)
     Y              python-config (symlink to python2.7-config)
 Y   Y              python2.7
 Y   Y              python2.7-config
                Y   python3 (hardlink to python3.2m)
                Y   python3-config (symlink to python3.2-config)
            Y   Y   python3.2 (hardlink to python3.2m)
                Y   python3.2-config (symlink to python3.2m-config)
            Y   Y   python3.2m
            Y   Y   python3.2m-config
 Y   Y              smtpd.py

     +              python2 (hardlink to python2.7)
     ?              idle2 (hardlink to idle)
     ?              pydoc2 (hardlink to pydoc)
     ?              python2-config (hardlink to python-config)
     X              2to3-2 (no need for 2 versions)

----
alt =  installed by "make altinstall"
ins =  installed by "make install"
Y = installed
m = optional combination of "d", "m", "u"
+ = currently in PEP 394
? = should be added to PEP 394
X = should not be added

-- 
 Ned Deily,
 nad at acm.org



More information about the Python-Dev mailing list