[Python-Dev] Excluding the current path from module search path?

Chris Withers chris at simplistix.co.uk
Tue Aug 25 17:59:44 CEST 2009

Hi All,

I'm being bitten by this issue:


I'm not sure I agree with Daniel's closing of it so thought I'd ask here...

Am I right in thinking that the general idea is that "the current 
working directory at the time of invoking a script or interpreter ends 
up on the python path" or should I be thinking "the directory that a 
script exists in should end up on the python path"?

If the latter, then what happens in the case of just starting up an 

If neither, then how come when I have two .py files in a directory, I 
can import one as a module from the other?

In any case, as a parting comment, http://bugs.python.org/issue1232023 
seems to have been committed with no tests and the only documentation 
being a one liner in the NEWS.txt file. Was there other discussion of this?

(Incidentally, export PYTHONPATH= or its Windows equivalent circumvents 
whatever the patch was trying to achieve, so the change doesn't seem to 
make sense anyway...)



Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk

More information about the Python-Dev mailing list