[Python-Dev] test_inspect failure

Tim Peters tim.one@comcast.net
Sat, 20 Apr 2002 23:12:25 -0400


I'm seeing test_inspect.py fail on Windows, but only when run under
regrtest:

C:\Code\python\PCbuild>python  ../lib/test/regrtest.py -v test_inspect.py
test_inspect
test test_inspect crashed -- exceptions.IndexError: list index out of range
Traceback (most recent call last):
  File "../lib/test/regrtest.py", line 315, in runtest
  File "../lib/test\test_inspect.py", line 167, in ?
    git.abuse(7, 8, 9)
  File "@test", line 39, in abuse
    self.argue(a, b, c)
  File "@test", line 46, in argue
    self.tr = inspect.trace()
  File "C:\CODE\PYTHON\lib\inspect.py", line 782, in trace
  File "C:\CODE\PYTHON\lib\inspect.py", line 763, in getinnerframes
  File "C:\CODE\PYTHON\lib\inspect.py", line 717, in getframeinfo
  File "C:\CODE\PYTHON\lib\inspect.py", line 413, in findsource
IndexError: list index out of range
1 test failed:
    test_inspect

C:\Code\python\PCbuild>

It's certainly curious that the traceback is missing all the code lines from
inspect.py!

Even curiouser, when run directly, no problem:

C:\Code\python\PCbuild>python  ../lib/test/test_inspect.py

C:\Code\python\PCbuild>

I'm using stock CVS, + defining WITH_UNIVERSAL_NEWLINES.  This is
suspicious, because when run under regrtest, test_inspect gets imported, and
then universal newlines kicks in (if I understood the PEP); I'm not clear on
whether universal newlines kicks in when a file is run directly.

Is anyone else with universal newlines (or without, for that matter ...)
seeing test_inspect fail?