Issue 4033: python search path - .pth recursion (original) (raw)

Issue4033

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:40 admin set github: 48283
2012-05-22 14:55:27 brett.cannon set status: open -> closedresolution: out of datemessages: +
2012-05-22 02:23:33 eric.araujo set nosy: + brett.cannon, ggenellina, gbloisiversions: + Python 3.3, - Python 3.1
2012-05-21 21:58:33 Matt.B set nosy: + Matt.B
2011-03-08 13:04:37 gwideman set nosy: + gwideman
2010-10-29 10:07:21 admin set assignee: georg.brandl -> docs@python
2010-08-03 22:00:56 terry.reedy set versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.5
2009-09-17 21:37:58 janssen set nosy: + janssenmessages: +
2008-10-03 21:15:08 jolleyjoe create