On 15 July 2013 14:53, Brett Cannon <br...@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
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to