[ python-Bugs-940286 ] pydoc.Helper.help() ignores input/output init parameters

SourceForge.net noreply at sourceforge.net
Thu Apr 22 16:11:10 EDT 2004


Bugs item #940286, was opened at 2004-04-22 20:11
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=940286&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Maxim Krikun (tws5)
Assigned to: Nobody/Anonymous (nobody)
Summary: pydoc.Helper.help() ignores input/output init parameters

Initial Comment:
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.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=940286&group_id=5470



More information about the Python-bugs-list mailing list