-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
pydoc -k IndexError on empty docstring #65747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
While trying to track down another bug, I disabled some packages: [dima@bmg tmp]$ chmod a-x /usr/lib/python3.4/site-packages/speechd* Then ran pydoc -k: [dima@bmg tmp]$ pydoc3.4 -k n688954789
Traceback (most recent call last):
File "/usr/bin/pydoc3.4", line 5, in <module>
pydoc.cli()
File "/usr/lib/python3.4/pydoc.py", line 2548, in cli
apropos(val)
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. |
Replacing 2061 with the following should work for all versions. |
Made change based on Terry J. Reedy's suggestion |
Thanks for the patch! It looks like the "synopsis" function also has this bug. Could you fix that, too? |
Here's a patch with tests. |
LGTM. |
New changeset 9436f43b6df2 by Benjamin Peterson in branch '3.4': New changeset 534b26837a13 by Benjamin Peterson in branch 'default': |
New changeset 43641e03692a by Berker Peksag in branch '2.7': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: