[ python-Bugs-1628895 ] Pydoc sets choices for doc locations incorrectly

SourceForge.net noreply at sourceforge.net
Fri Mar 2 15:37:33 CET 2007


Bugs item #1628895, was opened at 2007-01-05 16:24
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1628895&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: Pydoc sets choices for doc locations incorrectly

Initial Comment:
In pydoc.Helper.__init__ I see this code:

        execdir = os.path.dirname(sys.executable)
        homedir = os.environ.get('PYTHONHOME')
        for dir in [os.environ.get('PYTHONDOCS'),
                    homedir and os.path.join(homedir, 'doc'),
                    os.path.join(execdir, 'doc'),
                    '/usr/doc/python-docs-' + split(sys.version)[0],
                    '/usr/doc/python-' + split(sys.version)[0],
                    '/usr/doc/python-docs-' + sys.version[:3],
                    '/usr/doc/python-' + sys.version[:3],
                    os.path.join(sys.prefix, 'Resources/English.lproj/Documenta$            if dir and os.path.isdir(os.path.join(dir, 'lib')):
                self.docdir = dir

I think the third choice in the list of candidate directories is wrong.  execdir is the directory of the Python executable (e.g., it's /usr/local/bin by default).  I think it should be set as

    execdir = os.path.dirname(os.path.dirname(sys.executable))

You're not going to find a "doc" directory in /usr/local/bin.


----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2007-03-02 14:37

Message:
Logged In: YES 
user_id=849994
Originator: NO

Added some more search paths in rev. 54080.

----------------------------------------------------------------------

Comment By: Georg Brandl (gbrandl)
Date: 2007-03-01 10:25

Message:
Logged In: YES 
user_id=849994
Originator: NO

Looks like that is for Windows distributions, as there is
C:\Python24\python.exe and C:\Python24\Doc.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1628895&group_id=5470


More information about the Python-bugs-list mailing list