Ticket #112 (closed defect: worksforme)
error on help()
| Reported by: | donny.viszneki@… | Owned by: | xi |
|---|---|---|---|
| Priority: | normal | Component: | pyyaml |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by xi) (diff)
Using Windows XP and Python 2.5.1
C:\Documents and Settings\Joe Sizlack\Desktop\hackers>easy_install pyyaml
Searching for pyyaml
Reading http://pypi.python.org/simple/pyyaml/
Couldn't find index page for 'pyyaml' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
Reading http://pypi.python.org/simple/PyYAML/
Reading http://pyyaml.org/wiki/PyYAML
Best match: PyYAML 3.07
Downloading http://pyyaml.org/download/pyyaml/PyYAML-3.07.win32-py2.5.exe
Processing PyYAML-3.07.win32-py2.5.exe
creating 'c:\docume~1\joesiz~1\locals~1\temp\easy_install-5slfsi\PyYAML-3.07-py2
.5-win32.egg' and adding 'c:\docume~1\joesiz~1\locals~1\temp\easy_install-5slfsi
\PyYAML-3.07-py2.5-win32.egg.tmp' to it
Moving PyYAML-3.07-py2.5-win32.egg to c:\python25\lib\site-packages
Adding PyYAML 3.07 to easy-install.pth file
Installed c:\python25\lib\site-packages\pyyaml-3.07-py2.5-win32.egg
Processing dependencies for pyyaml
Finished processing dependencies for pyyaml
C:\Documents and Settings\Joe Sizlack\Desktop\hackers>python
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml
>>> help(yaml)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python25\lib\site.py", line 346, in __call__
return pydoc.help(*args, **kwds)
File "C:\Python25\lib\pydoc.py", line 1645, in __call__
self.help(request)
File "C:\Python25\lib\pydoc.py", line 1689, in help
else: doc(request, 'Help on %s:')
File "C:\Python25\lib\pydoc.py", line 1481, in doc
pager(title % desc + '\n\n' + text.document(object, name))
File "C:\Python25\lib\pydoc.py", line 324, in document
if inspect.ismodule(object): return self.docmodule(*args)
File "C:\Python25\lib\pydoc.py", line 1072, in docmodule
contents.append(self.document(value, key, name))
File "C:\Python25\lib\pydoc.py", line 325, in document
if inspect.isclass(object): return self.docclass(*args)
File "C:\Python25\lib\pydoc.py", line 1196, in docclass
lambda t: t[1] == 'method')
File "C:\Python25\lib\pydoc.py", line 1146, in spill
name, mod, object))
File "C:\Python25\lib\pydoc.py", line 326, in document
if inspect.isroutine(object): return self.docroutine(*args)
File "C:\Python25\lib\pydoc.py", line 1257, in docroutine
doc = getdoc(object) or ''
File "C:\Python25\lib\pydoc.py", line 82, in getdoc
result = inspect.getdoc(object) or inspect.getcomments(object)
File "C:\Python25\lib\inspect.py", line 521, in getcomments
lines, lnum = findsource(object)
File "C:\Python25\lib\inspect.py", line 510, in findsource
if pat.match(lines[lnum]): break
IndexError: list index out of range
>>>
Attachments
Change History
comment:2 Changed 4 years ago by xi
- Status changed from new to closed
- Resolution set to worksforme
- Description modified (diff)
help(yaml) works for me both when I install the package directly or when I use easy_install.
In any case, if you google for last lines in the traceback, you'll notice it's not really a PyYAML issue. It appears this problem occurs when inspect.findsource() is unable to find a correct .py file corresponding to the .pyc file that is currently in use. It may happen if the .pyc file was built on a different machine or has been moved around. Do you happen to have more than one version of PyYAML installed using easy_install? If so, I would suggest you to remove all existing PyYAML installations and re-install it from scratch.

With proper formatting:
C:\Documents and Settings\Joe Sizlack\Desktop\hackers>easy_install pyyaml Searching for pyyaml Reading http://pypi.python.org/simple/pyyaml/ Couldn't find index page for 'pyyaml' (maybe misspelled?) Scanning index of all packages (this may take a while) Reading http://pypi.python.org/simple/ Reading http://pypi.python.org/simple/PyYAML/ Reading http://pyyaml.org/wiki/PyYAML Best match: PyYAML 3.07 Downloading http://pyyaml.org/download/pyyaml/PyYAML-3.07.win32-py2.5.exe Processing PyYAML-3.07.win32-py2.5.exe creating 'c:\docume~1\joesiz~1\locals~1\temp\easy_install-5slfsi\PyYAML-3.07-py2 .5-win32.egg' and adding 'c:\docume~1\joesiz~1\locals~1\temp\easy_install-5slfsi \PyYAML-3.07-py2.5-win32.egg.tmp' to it Moving PyYAML-3.07-py2.5-win32.egg to c:\python25\lib\site-packages Adding PyYAML 3.07 to easy-install.pth file Installed c:\python25\lib\site-packages\pyyaml-3.07-py2.5-win32.egg Processing dependencies for pyyaml Finished processing dependencies for pyyaml C:\Documents and Settings\Joe Sizlack\Desktop\hackers>python Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import yaml >>> help(yaml) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python25\lib\site.py", line 346, in __call__ return pydoc.help(*args, **kwds) File "C:\Python25\lib\pydoc.py", line 1645, in __call__ self.help(request) File "C:\Python25\lib\pydoc.py", line 1689, in help else: doc(request, 'Help on %s:') File "C:\Python25\lib\pydoc.py", line 1481, in doc pager(title % desc + '\n\n' + text.document(object, name)) File "C:\Python25\lib\pydoc.py", line 324, in document if inspect.ismodule(object): return self.docmodule(*args) File "C:\Python25\lib\pydoc.py", line 1072, in docmodule contents.append(self.document(value, key, name)) File "C:\Python25\lib\pydoc.py", line 325, in document if inspect.isclass(object): return self.docclass(*args) File "C:\Python25\lib\pydoc.py", line 1196, in docclass lambda t: t[1] == 'method') File "C:\Python25\lib\pydoc.py", line 1146, in spill name, mod, object)) File "C:\Python25\lib\pydoc.py", line 326, in document if inspect.isroutine(object): return self.docroutine(*args) File "C:\Python25\lib\pydoc.py", line 1257, in docroutine doc = getdoc(object) or '' File "C:\Python25\lib\pydoc.py", line 82, in getdoc result = inspect.getdoc(object) or inspect.getcomments(object) File "C:\Python25\lib\inspect.py", line 521, in getcomments lines, lnum = findsource(object) File "C:\Python25\lib\inspect.py", line 510, in findsource if pat.match(lines[lnum]): break IndexError: list index out of range >>>