[Python-Dev] .pth files in current or script directory

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Sun May 16 20:11:23 EDT 2004


Guido van Rossum wrote:

> Can't they manipulate sys.path *inside* the code in question?  That's
> invariably the solution I end up using -- I never play with
> PYTHONPATH any more.

I do this too, but I always feel that I shouldn't have to, especially
when I'm not using `sys` for anything else. It also messes up my desire
to keep all the imports together - the `sys` magic needs to go first.

Jeff Epler wrote:

> I'm -NFS against reading .pth files from the current directory.
> When a directory is large and is on a remote filesystem, enumerating
> it at startup can really kill time -- heck, just putting an NFS
> directory with a handful of entries in PYTHONPATH can slow Python's
> startup time considerably, now imagine that you "cd
> /nfs/directory_with_1000_files" and "time python -c 'pass'" .. blah!

I don't use NFS so I've no experience with the performance problems
involved. Of course, Windows shares would have similar issues.

Hmm - would this objection go away if a specific filename were mandated
for these .pth files - e.g. pythonpath.pth? 

Tim Delaney



More information about the Python-Dev mailing list