[New-bugs-announce] [issue1550] help('modules') broken by several 3rd party libraries (svn patch attached)

Ben Hayden report at bugs.python.org
Mon Dec 3 17:34:09 CET 2007

New submission from Ben Hayden:

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

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

components: Demos and Tools, Library (Lib)
files: pydocbug.patch
messages: 58131
nosy: benjhayden
severity: minor
status: open
title: help('modules') broken by several 3rd party libraries (svn patch attached)
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file8863/pydocbug.patch

Tracker <report at bugs.python.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pydocbug.patch
Type: application/octet-stream
Size: 1328 bytes
Desc: not available
Url : http://mail.python.org/pipermail/new-bugs-announce/attachments/20071203/dd77e4fc/attachment.obj 

More information about the New-bugs-announce mailing list