Skip to content

python search path - .pth recursion #48283

Closed

Description

@jolleyjoe
mannequin
BPO 4033
Nosy @brettcannon, @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-05-22.14:55:27.897>
created_at = <Date 2008-10-03.21:15:08.798>
labels = ['type-bug', 'docs']
title = 'python search path - .pth recursion'
updated_at = <Date 2012-05-22.14:55:27.897>
user = 'https://bugs.python.org/jolleyjoe'

bugs.python.org fields:

activity = <Date 2012-05-22.14:55:27.897>
actor = 'brett.cannon'
assignee = 'docs@python'
closed = True
closed_date = <Date 2012-05-22.14:55:27.897>
closer = 'brett.cannon'
components = ['Documentation']
creation = <Date 2008-10-03.21:15:08.798>
creator = 'jolleyjoe'
dependencies = []
files = []
hgrepos = []
issue_num = 4033
keywords = []
message_count = 3.0
messages = ['74274', '92797', '161360']
nosy_count = 8.0
nosy_names = ['brett.cannon', 'georg.brandl', 'janssen', 'ggenellina', 'gbloisi', 'jolleyjoe', 'gwideman', 'Matt.B']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue4033'
versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

Activity

  1. jolleyjoe commented on Oct 3, 2008

    jolleyjoemannequin
    MannequinAuthor

    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).

  2. added
    docs
    type-bug
    on Oct 3, 2008
  3. janssen commented on Sep 17, 2009

    janssenmannequin
    Mannequin

    Looks like 1431 was closed by removing a line from the documentation, so
    it's not surprising that it's not clear.

  4. brettcannon commented on May 22, 2012

    @brettcannon
    Member

    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.

  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docstype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions