[Distutils] Replacing pip.exe with a Python script

Paul Moore p.f.moore at gmail.com
Mon Jul 15 16:41:15 CEST 2013


On 15 July 2013 15:32, Nick Coghlan <ncoghlan at gmail.com> wrote:

> Most of the stuff Brett mentioned there shouldn't be relevant for a
> directly executed script - doing
> sys.path.remove(os.path.dirname(os.path.abspath(__file__)) should be
> pretty robust in any scenario.
>

OK, well apart from the shadowing issue, my initial tests have looked
relatively positive. So the questions are now more around whether this is
how we want to go with pip, what backward compatibility issues it may have
(the launcher isn't available in Python < 3.3) etc. So I'll work up a pull
request for discussion by the pip devs.


> > I'm amazed actually that there's no way to say
> > "don't add the script location to sys.path", even as a command line
> option.
> > It seems like the sort of thing you'd want to make scripts robust, a bit
> > like -S and -E.
>
> You'd think that, but then you'd look at getpath.c and run away (or
> write something like PEP 432, as I did) :P
>

You're a better man than I, Gunga Din :-)

Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130715/80b676e4/attachment-0001.html>


More information about the Distutils-SIG mailing list