inspect.stack() or inspect.currentframe() gives "list index out of range error"

Terry Reedy tjreedy at udel.edu
Sat Sep 25 13:12:07 EDT 2010


On 9/25/2010 3:53 AM, deluxstar wrote:

> The traceback is:
> 2010-09-25 10:50:38+0300 [-] Traceback (most recent call last):
> 2010-09-25 10:50:38+0300 [-]   File "../appsrv/lqcommon.py", line 983,
> in getPRMS
> 2010-09-25 10:50:38+0300 [-]   File "/usr/lib/python2.6/inspect.py",
> line 931, in getouterframes
> 2010-09-25 10:50:38+0300 [-]     framelist.append((frame,) +
> getframeinfo(frame, context))
> 2010-09-25 10:50:38+0300 [-]   File "/usr/lib/python2.6/inspect.py",
> line 906, in getframeinfo
> 2010-09-25 10:50:38+0300 [-]     lines, lnum = findsource(frame)
> 2010-09-25 10:50:38+0300 [-]   File "/usr/lib/python2.6/inspect.py",
> line 568, in findsource
> 2010-09-25 10:50:38+0300 [-]     if pat.match(lines[lnum]): break
> 2010-09-25 10:50:38+0300 [-] IndexError: list index out of range
>
> It is hard to reproduce the error with a script. I will work and send
> if I success.
> If the traceback tells smth, please tell me :)

The traceback is terribly difficult to read with the timestamps added. 
They are not from Python. In the future, please try to suppress them or 
use a global search/replace (with nothing) before posting such.

-- 
Terry Jan Reedy




More information about the Python-list mailing list