[Distutils] Replacing pip.exe with a Python script

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


On 15 July 2013 14:53, Brett Cannon <brett at python.org> wrote:

> As long as you make sure that sys.path[0] is actually the script location
> then it will work (other things like .pth files, PYTHONSTARTUP, etc. could
> have changed things before your script started execution). But realize that
> a) in Python 3.3 the scripts location will be ./pip.py, not just pip.py,
> and b) if I get my way all paths will be absolute for __file__, so you will
> have to just associate '' with os.getcwd()  and then search for the proper
> directory on sys.path.


OK, that pretty much tells me that this is a bad idea. It's never going to
be robust enough to work. 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.

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


More information about the Distutils-SIG mailing list