This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: help('modules') broken by several 3rd party libraries (svn patch attached)
Type: behavior Stage:
Components: Demos and Tools, Library (Lib) Versions: Python 3.0, Python 2.6, Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: ping Nosy List: benjhayden, ping
Priority: normal Keywords: easy, patch

Created on 2007-12-03 16:34 by benjhayden, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pydocbug.patch benjhayden, 2007-12-03 16:34
Messages (2)
msg58131 - (view) Author: Ben Hayden (benjhayden) Date: 2007-12-03 16:34
Instead of listing installed modules, help('modules') prints a "please
wait" message, then a traceback noting that a module raised an exception
during import, then nothing else.
This happens in 2.5 and 2.6a0, but not in 2.4, which apparently doesn't
__import__() EVERY module.
Tested only on Gentoo Linux 2.6.19, but same behavior is probable on
other platforms because pydoc and pkgutil are written in cross-platform
Python.

Prominent 3rd party libraries that break help('modules') include Django,
Pyglet, wxPython, SymPy, and Pypy. Arguably, the bug is in those
libraries, but they have good reasons for their behavior. Also, the Unix
philosophy of forgiving input is a good one. Also, __import__()ing every
module takes a significant run-time hit, especially if libraries compute
eg. configuration.

The patch utilizes a pre-existing hook in pkgutil to simply quietly add
the module to the output. (Long live lambda.)
msg59852 - (view) Author: Ka-Ping Yee (ping) * (Python committer) Date: 2008-01-13 11:32
Committed the patch in revision 59939.

I'm not clear how it was determined that importing every module was
necessary in order to list the modules or scan their synopsis lines
(this seems to have happened in revision 45510).  This can probably
be made more efficient in the future.
History
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45891
2008-01-13 11:32:19pingsetstatus: open -> closed
resolution: accepted
messages: + msg59852
2008-01-12 01:03:30akuchlingsetkeywords: + easy
2007-12-09 02:02:29christian.heimessetpriority: normal
assignee: ping
nosy: + ping
keywords: + patch
versions: + Python 3.0
2007-12-03 16:34:09benjhaydencreate