Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue21548

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:pydoc -k IndexError on empty docstring
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.4, Python 3.5, Python 2.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Dima.Tisnek, Yuyang.Guo, benjamin.peterson, berker.peksag, python-dev, serhiy.storchaka, terry.reedy
Priority:normalKeywords:easy, patch

Created on2014-05-21 08:43 byDima.Tisnek, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
issue21548.patchYuyang.Guo,2014-06-07 18:13review
issue21548.diffberker.peksag,2015-01-25 00:30review
Messages (8)
msg218865 -(view)Author: Dima Tisnek (Dima.Tisnek)*Date: 2014-05-21 08:43
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 n688954789Traceback (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 rangeClearly "".splitlines() is always empty; missing doc is not handled correctly.
msg218998 -(view)Author: Terry J. Reedy (terry.reedy)*(Python committer)Date: 2014-05-23 21:07
Replacing 2061 with the following should work for all versions.desc = module.__doc__.splitlines()[0] if module.__doc__ else ''
msg219956 -(view)Author: Yuyang Guo (Yuyang.Guo)*Date: 2014-06-07 18:13
Made change based on Terry J. Reedy's suggestion
msg219971 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2014-06-07 20:13
Thanks for the patch! It looks like the "synopsis" function also has this bug. Could you fix that, too?
msg234641 -(view)Author: Berker Peksag (berker.peksag)*(Python committer)Date: 2015-01-25 00:30
Here's a patch with tests.
msg236117 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2015-02-16 22:44
LGTM.
msg236119 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-02-17 00:45
New changeset9436f43b6df2 by Benjamin Peterson in branch '3.4':fix pydoc.apropos and pydoc.synopsis on modules with empty docstrings (#21548)https://hg.python.org/cpython/rev/9436f43b6df2New changeset534b26837a13 by Benjamin Peterson in branch 'default':merge 3.4 (#21548)https://hg.python.org/cpython/rev/534b26837a13
msg236261 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-02-20 10:09
New changeset43641e03692a by Berker Peksag in branch '2.7':Issue#21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with emptyhttps://hg.python.org/cpython/rev/43641e03692a
History
DateUserActionArgs
2022-04-11 14:58:03adminsetgithub: 65747
2015-02-20 10:10:26berker.peksagsetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2015-02-20 10:09:38python-devsetmessages: +msg236261
2015-02-17 00:45:49python-devsetnosy: +python-dev
messages: +msg236119
2015-02-16 22:44:14serhiy.storchakasetnosy: +serhiy.storchaka

messages: +msg236117
stage: patch review -> commit review
2015-01-25 00:30:55berker.peksagsetfiles: +issue21548.diff

nosy: +berker.peksag
messages: +msg234641

stage: patch review
2014-06-07 20:13:13benjamin.petersonsetnosy: +benjamin.peterson
messages: +msg219971
2014-06-07 18:13:15Yuyang.Guosetfiles: +issue21548.patch

nosy: +Yuyang.Guo
messages: +msg219956

keywords: +patch
2014-06-02 00:38:33r.david.murraysetkeywords: +easy
2014-05-23 21:07:00terry.reedysetversions: + Python 2.7, Python 3.5
nosy: +terry.reedy

messages: +msg218998

type: behavior
2014-05-21 08:43:03Dima.Tisnekcreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp