Title: python search path - .pth recursion
Type: behavior Stage:
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
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 2012-05-22 14:55 by brett.cannon. 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:


In dir_b, I have a b.pth file that lists some eggs in dir_b:


"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:, 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: says it is not recursive. And looking at the code ( backs that up.
Date User Action Args
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