Setting sys.path when building python

Gordon McMillan gmcm at hypernet.com
Sun Aug 13 17:38:38 EDT 2000


Brian Reynolds wrote:

>As built out of the box (i.e., './configure; make; make test; make
>install') the value of sys.path includes the current working directory
>(i.e., '.').  On a multiuser OS this is a Bad Idea(tm).

Not exactly. If you pass it a script, that script's directory is 
sys.path[0] unless the script's directory is the current directory, in 
which case I see '' as sys.path[0]. 

>I would like to build python so that the built in default value of
>sys.path does not include the current working directory.  How would I
>go about doing this?  I guess what I'm looking for is the source file
>where sys.path is initialized when python is built.

getpath.c

- Gordon



More information about the Python-list mailing list