[IPython-user] help(curses) fails - list index out of range

Chris Jones cjns1989@gmail....
Sat Feb 21 20:10:46 CST 2009


I'm running ipython and I'm trying to access the interactive doc for the
curses module.

I type "help(curses)" from the prompt and I get about one page of
"Traceback" followed by the "IndexError: list index out of range"
message.

As I understand it the curses documentation is available in:

  /usr/share/doc/python/python/html/lib

which is what I specified in my PYTHONDOCS environment variable.

--

/home/gavron/devel/ncurses/python/pydoc.py in getdoc(object)
     73 def getdoc(object):
     74     """Get the doc string or comments for an object."""
---> 75     result = inspect.getdoc(object) or inspect.getcomments(object)
     76     return result and re.sub('^ *\n', '', rstrip(result)) or ''
     77

/home/gavron/devel/ncurses/python/inspect.py in getcomments(object)
    446     """
    447     try:
--> 448         lines, lnum = findsource(object)
    449     except (IOError, TypeError):
    450         return None

/home/gavron/devel/ncurses/python/inspect.py in findsource(object)
    435         pat = re.compile(r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)')
    436         while lnum > 0:
--> 437             if pat.match(lines[lnum]): break
    438             lnum = lnum - 1
    439         return lines, lnum

IndexError: list index out of range

--

Am I doing something I shouldn't or is there anything wrong with my
setup?

Thanks,

CJ



More information about the IPython-user mailing list