[Python-Dev] PEP 394 request for pronouncement (python2 symlink in *nix systems)

Nick Coghlan ncoghlan at gmail.com
Mon Feb 13 03:31:45 CET 2012


On Mon, Feb 13, 2012 at 6:42 AM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
>> IMO a symlink is far and away the better choice in this situation.
>
> Please wait with that judgment until you see the rationale of the PEP
> author.

Kerrick did post a rationale in the last thread [1], but it never made
it into the PEP itself. The relevant comment:

==========
Also, I updated the PEP with the clarification that commands like
python3 should be hard links (because they'll be invoked from code and
are more efficient; also, hard links are just as flexible as symlinks
here), while commands like python should be soft links (because this
makes it clear to sysadmins that they can be "switched", and it's
needed for flexibility if python3 changes). This really doesn't
matter, but can we keep it this way unless there are serious
objections?
==========

I think Antoine makes a good point about ease of introspection when
you have multiple versions in the same series installed, so I'd be
fine with:
- updating the PEP recommendation to say that either form of link is
fine (with hard links marginally faster, but harder to introspect)
- noting that python.org releases will consistently use symlinks for
easier introspection via "ls -l"
- updating Makefile.pre.in to ensure that we really do consistently use symlinks

This does mean that launching Python may involve a slightly longer
symlink chain in some cases (python -> python2 -> python2.7), but the
impact of that is always going to be utterly dwarfed by other startup
costs.

[1] http://mail.python.org/pipermail/python-dev/2011-July/112322.html

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list