CrashHandler doesn't inspect modules properly

Bug #515652 reported by Brian Granger on 2010-02-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fernando Perez

Bug Description

If I make Magic an object and look at the crash reporter I see things like:

       global The = undefined
       global Component = <class 'IPython.core.component.Component'>
       global subclass = undefined
       global that = undefined
       instance = undefined
       global will = undefined
       global = undefined
       global to = undefined
       global be. = undefined

The variables here are not in Python code but are words from a
docstring in that module.
Any idea on what is going on here?

Is it by any chance being loaded at runtime and the file may have
changed since you started ipython? The python inspection libraries
have caching bugs, I try in several places to flush those caches to
avoid this problem, but I may not be doing it right everywhere.

This is old, old, horrible code I hacked very early on in ipython's
life on top of something I hadn't written and that was pretty bad to
begin with. It's in serious need of a test suite so it can be

At least as a pointer, the machinery responsible is around here:

So what's happening is that the list of 'unique names' being generated
is for some reason being computed from the wrong line of code, so text
from a docstring is read instead of text from the proper line of
source that originated the exception.

Sorry not to be more helpful, this is something that needs a solid
chunk of deep work at some point, not something we can clear quickly
(the refactoring I mean, this little bug might be fixable with a
one-line change somewhere).

Changed in ipython:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Fernando Perez (fdo.perez)
milestone: none → 0.11
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers