You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From http://www.python.org/doc/2.5.2/inst/search-path.html:
"Paths can be absolute or relative, in which case they're relative to
the directory containing the .pth file. Any directories added to the
search path will be scanned in turn for .pth files. See site module
documentation for more information."
I assume that .pth files are scanned recursively... is this true?
I found an old ticket here: http://bugs.python.org/issue1431, but it
wasn't clear how it concludes (ie: do .pth files get scanned recursively
for directories to add to the search path or not).
Activity
jolleyjoe commentedon Oct 3, 2008
I have an a.pth file in dir_a with a line that says:
dir_b
In dir_b, I have a b.pth file that lists some eggs in dir_b:
JCC-1.9-py2.5-linux-i686.egg
lucene-2.3.2-py2.5-linux-i686.egg
From http://www.python.org/doc/2.5.2/inst/search-path.html:
"Paths can be absolute or relative, in which case they're relative to
the directory containing the .pth file. Any directories added to the
search path will be scanned in turn for .pth files. See site module
documentation for more information."
I assume that .pth files are scanned recursively... is this true?
I found an old ticket here: http://bugs.python.org/issue1431, but it
wasn't clear how it concludes (ie: do .pth files get scanned recursively
for directories to add to the search path or not).
janssen commentedon Sep 17, 2009
Looks like 1431 was closed by removing a line from the documentation, so
it's not surprising that it's not clear.
brettcannon commentedon May 22, 2012
The docs for 2.7 are a little more clear: http://docs.python.org/install/index.html#inst-search-path says it is not recursive. And looking at the code (http://hg.python.org/cpython/file/086afe7b61f5/Lib/site.py#l184) backs that up.