[Python-bugs-list] [ python-Bugs-411060 ] pydoc helpe(help) fails

noreply@sourceforge.net noreply@sourceforge.net
Sat, 24 Mar 2001 08:21:43 -0800


Bugs item #411060, was updated on 2001-03-24 08:21
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=411060&group_id=5470

Category: Python Library
Group: None
Status: Open
Priority: 5
Submitted By: Emile van Sebille (evansebille)
Assigned to: Nobody/Anonymous (nobody)
Summary: pydoc helpe(help) fails

Initial Comment:
from pydoc import help
help(help)
-->
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "c:\python21\lib\pydoc.py", line 1147, in 
__call__
    doc(args[0])
  File "c:\python21\lib\pydoc.py", line 1106, in doc
    pager('Help on %s:\n\n' % desc + text.document
(thing))
  File "c:\python21\lib\pydoc.py", line 196, in 
document
    return apply(self.docother, args)
  File "c:\python21\lib\pydoc.py", line 895, in 
docother
    line = self.bold(name) + ' = ' + repr
  File "c:\python21\lib\pydoc.py", line 700, in bold
    return join(map(lambda ch: ch + '\b' + ch, 
text), '')
TypeError: argument 2 to map() must be a sequence 
object

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

by changing Helper in pydoc.py and wrapping calls in 
try/except:

    def __call__(self, *args):
        try:
            doc(args[0])
        except:
            print repr(self)


you get:

>>> help(help)
To get help on a Python object, call help(object).
To get help on a module or package, either import it 
before calling
help(module) or call help('modulename').
>>> 

This is obviously not the place to change it, but it 
did help!  ;-)



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

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