This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python search path - .pth recursion
Type: behavior Stage:
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Matt.B, brett.cannon, gbloisi, georg.brandl, ggenellina, gwideman, janssen, jolleyjoe
Priority: normal Keywords:

Created on 2008-10-03 21:15 by jolleyjoe, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg74274 - (view) Author: jolleyjoe (jolleyjoe) Date: 2008-10-03 21:15
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).
msg92797 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2009-09-17 21:37
Looks like 1431 was closed by removing a line from the documentation, so
it's not surprising that it's not clear.
msg161360 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-05-22 14:55
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.
History
Date User Action Args
2022-04-11 14:56:40adminsetgithub: 48283
2012-05-22 14:55:27brett.cannonsetstatus: open -> closed
resolution: out of date
messages: + msg161360
2012-05-22 02:23:33eric.araujosetnosy: + brett.cannon, ggenellina, gbloisi

versions: + Python 3.3, - Python 3.1
2012-05-21 21:58:33Matt.Bsetnosy: + Matt.B
2011-03-08 13:04:37gwidemansetnosy: + gwideman
2010-10-29 10:07:21adminsetassignee: georg.brandl -> docs@python
2010-08-03 22:00:56terry.reedysetversions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.5
2009-09-17 21:37:58janssensetnosy: + janssen
messages: + msg92797
2008-10-03 21:15:08jolleyjoecreate