Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange internal traceback #2112

Closed
schwehr opened this issue Jul 8, 2012 · 3 comments
Closed

Strange internal traceback #2112

schwehr opened this issue Jul 8, 2012 · 3 comments
Milestone

Comments

@schwehr
Copy link

schwehr commented Jul 8, 2012

With IPython 0.13 on Python 2.7.3 (default, Apr 15 2012, 16:15:00) from Mac OSX 10.7 (64bit) via fink:

The code in this pastebin causes the following strange traceback when run:

http://pastebin.com/wrFn1zMT

ERROR: Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
  File "/sw/lib/python2.7/site-packages/IPython/core/ultratb.py", line 756, in structured_traceback
    records = _fixed_getinnerframes(etb, context, tb_offset)
  File "/sw/lib/python2.7/site-packages/IPython/core/ultratb.py", line 242, in _fixed_getinnerframes
    records  = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
  File "/sw/lib/python2.7/inspect.py", line 1043, in getinnerframes
    framelist.append((tb.tb_frame,) + getframeinfo(tb, context))
  File "/sw/lib/python2.7/inspect.py", line 1007, in getframeinfo
    lines, lnum = findsource(frame)
  File "/sw/lib/python2.7/inspect.py", line 580, in findsource
    if pat.match(lines[lnum]): break
IndexError: list index out of range

Unfortunately, your original traceback can not be constructed.
@fperez
Copy link
Member

fperez commented Jul 8, 2012

Mmh, that's really odd. It works just fine for me here, on a Linux 64b build of python 2.7.3:

In [6]: run /home/fperez/f.py
version: ['0.8.0']
0 pandas-0.8.0.tar.gz
match: .tar.gz pandas-0.8.0.tar.gz
1 pandas-0.8.0.win-amd64-py2.6.exe
2 pandas-0.8.0.win-amd64-py2.7.exe
3 pandas-0.8.0.win-amd64-py3.1.exe
4 pandas-0.8.0.win-amd64-py3.2.exe
5 pandas-0.8.0.win32-py2.5.exe
6 pandas-0.8.0.win32-py2.6.exe
7 pandas-0.8.0.win32-py2.7.exe
8 pandas-0.8.0.win32-py3.1.exe
9 pandas-0.8.0.win32-py3.2.exe
10 pandas-0.8.0.zip
match: .zip pandas-0.8.0.zip
possible_url {'.tar.gz': 0, '.zip': 10}
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
/home/fperez/usr/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    177             else:
    178                 filename = fname
--> 179             __builtin__.execfile(filename, *where)

/home/fperez/f.py in <module>()
     38 
     39 if __name__ == '__main__':
---> 40     try_me()
     41 

/home/fperez/f.py in try_me()
     34 
     35 def try_me():
---> 36     package_data = package_url('pandas')
     37     print package_data
     38 

/home/fperez/f.py in package_url(package_name)
     29             entry_num = possible_url[pref]
     30             break
---> 31     assert entry_num
     32 
     33     return urls[entry_num]

AssertionError: 

where f.py is just my save of your pastebin. I know we've had these 'internal inspect errors' occasionally, and I got excited that you might have found a reproducible case so we can finally track things down. But again, it seems this type of error is very, very tricky to replicate. I suspect the inspect module has hidden state that gets messed up, but I haven't done a full audit to see where that could be the case.

But that's what makes these so hard to debug: they only seem to occur during long work sessions, and we've never found a way to replicate one in isolation.

@schwehr
Copy link
Author

schwehr commented Jul 9, 2012

yeah, I only posted this in hopes that it would correlate with something someone else had seen

@fperez
Copy link
Member

fperez commented Jul 9, 2012

I'm going to close it in the sense that this one by itself won't help us fix the problem, but it's still useful to have a record in case we eventually find a way to set the problematic state. So thanks for the report!

@fperez fperez closed this as completed Jul 9, 2012
@minrk minrk added this to the no action milestone Mar 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants