[New-bugs-announce] [issue21548] pydoc -k IndexError on empty docstring

Dima Tisnek report at bugs.python.org
Wed May 21 10:43:03 CEST 2014

New submission from Dima Tisnek:

While trying to track down another bug, I disabled some packages:

[dima at bmg tmp]$ chmod a-x /usr/lib/python3.4/site-packages/speechd*

Then ran pydoc -k:

[dima at bmg tmp]$ pydoc3.4 -k n688954789
Traceback (most recent call last):
  File "/usr/bin/pydoc3.4", line 5, in <module>
  File "/usr/lib/python3.4/pydoc.py", line 2548, in cli
  File "/usr/lib/python3.4/pydoc.py", line 2080, in apropos
    ModuleScanner().run(callback, key, onerror=onerror)
  File "/usr/lib/python3.4/pydoc.py", line 2061, in run
    desc = (module.__doc__ or '').splitlines()[0]
IndexError: list index out of range

Clearly "".splitlines() is always empty; missing doc is not handled correctly.

components: Library (Lib)
messages: 218865
nosy: Dima.Tisnek
priority: normal
severity: normal
status: open
title: pydoc -k IndexError on empty docstring
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list