PYTHONDOCS
J. D. Leach
jdleach04 at sbcglobal.net
Mon Jan 2 15:15:11 EST 2006
Peter Otten wrote:
> What do you get if you do
>
>>>> import pydoc
>>>> pydoc.help.docdir
> '/should/be/path/to/docs'
The response is:
>>>import pydoc
>>>print pydoc.help.docdir
None
>>>
Obviously not there.
>
> I believe there is a bug in the documentation-finding code. With the
> current logic PYTHONDOCS will only be honoured if none of the following
> directories exist:
>
> $PYTHONHOME/lib
> (sys.executable)/doc/lib
> /usr/doc/python-docs-2.4.2/lib
> /usr/doc/python-2.4.2/lib
> /usr/doc/python-docs-2.4/lib
> /usr/doc/python-2.4/lib
> (sys.prefix)/Resources/English.lproj/Documentation/lib
>
> I think (untested) the proper fix would be an extra break
>
> --- pydoc.py 2006-01-02 18:54:04.870404232 +0100
> +++ pydoc1.py 2006-01-02 18:54:30.440516984 +0100
> @@ -1635,6 +1635,7 @@
> os.path.join(sys.prefix,
> 'Resources/English.lproj/Documentation')]:
> if dir and os.path.isdir(os.path.join(dir, 'lib')):
> self.docdir = dir
> + break
>
> def __repr__(self):
> if inspect.stack()[1][3] == '?':
>
> Consider filing a bug report.
>
> Peter
I believe you are right, a bug report is probably warranted here.
--
J. D. Leach
Columbus, Indiana USA
More information about the Python-list
mailing list