Benjamin Rutt wrote: > Am I correct in understanding that: > > 1) foo.pth will be used if it is in the directory > /usr/lib/python-2.4/site-packages > > 2) foo.pth will not be read from if it is only placed somewhere in the > PYTHONPATH environment, such as foo.pth exists as the file > /tmp/bar/foo.pth, where PYTHONPATH contains "/tmp/bar"?
Both by inspection of the source and by experimentation, it appears you are correct. As the docs say, only the "site-specific paths" (i.e. sys.prefix and sys.exec_prefix, and lib/python<version>/site-packages and lib/site-python) are actually scanned for .pth files, plus any paths added as a result of parsing .pth files that are found. If you want to modify or extend this behaviour, you should take advantage of sitecustomize.py by adding your own behaviour, perhaps scanning os.environ['PYTHONPATH'] to look for .pth files. -Peter -- http://mail.python.org/mailman/listinfo/python-list