[IPython-user] ERROR: Internal Python error in the inspect module.

Robert Kern robert.kern at gmail.com
Mon Oct 17 15:08:01 CDT 2005


Ryan Krauss wrote:
> I found it.  I went through the code with the pdb and realized I was
> forgetting that a=b just creates a reference for a complex data type. 
> It seems like the underlying problem is that I ended up trying to plot
> 2 vectors of different lengths using pylab.semilogx(x,y).  I was
> truncating vector y each time I ran the file.  This error message just
> made the whole thing seem catastrophic.
> 
> On 10/17/05, Ryan Krauss <ryanlists at gmail.com> wrote:
> 
>>I have a script that runs fine the first time and then if I run it
>>again (without modification) I get this error:
>>
>>In [3]:run thetafb.py
>>ERROR: Internal Python error in the inspect module.
>>Below is the traceback from this internal error.
>>
>>Traceback (most recent call last):
>>  File "../../ipython/usr/lib/python2.4/site-packages/IPython/ultraTB.py",
>>line 434, in text
>>  File "/usr/lib/python2.4/inspect.py", line 811, in getinnerframes
>>    framelist.append((tb.tb_frame,) + getframeinfo(tb, context))
>>  File "/usr/lib/python2.4/inspect.py", line 775, in getframeinfo
>>    lines, lnum = findsource(frame)
>>  File "/usr/lib/python2.4/inspect.py", line 437, in findsource
>>    if pat.match(lines[lnum]): break
>>IndexError: list index out of range

Check the line endings of the file that it's searching. I've come across
this with small __init__.py files that had Windows line endings while I
was on a Mac. Also, check that the last line ends in a newline.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
 Are the graves of dreams allowed to die."
  -- Richard Harter




More information about the IPython-user mailing list