Message60481
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.
|
|
Date |
User |
Action |
Args |
2008-01-20 09:56:51 | admin | link | issue940286 messages |
2008-01-20 09:56:51 | admin | create | |
|