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.

Author tws5
Recipients
Date 2004-04-22.20:11:10
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The ourput of pydoc.Helper help() method is always sent
to sys.stdout, even if Helper was supplied with
different input/output streams at initialization. Other
methods: listtopics etc. work as expected.

Example:
########################

import sys, pydoc
from StringIO import StringIO

buf=StringIO()
H=pydoc.Helper(sys.stdin,buf)

H.listtopics()
H.help("pydoc")
#at this point help on pydoc is printed to stdout
H.listtopics()

ss=buf.getvalue()
print ss
#at this point the list of topics is printed twice

########################

sys.version:
 '2.3 (#46, Aug 11 2003, 09:34:05) [MSC v.1200 32 bit
(Intel)]'

The problem persists in pydoc.py version 1.90 from CVS.

The reason for such behaviour is a call to global (in
module scope) function doc() at line 1628 in pydoc.py 1.90.
which doesn't care about Helper.input Helper.output
settings.
History
Date User Action Args
2008-01-20 09:56:51adminlinkissue940286 messages
2008-01-20 09:56:51admincreate