Comment 18 for bug 381069

Revision history for this message
Minjae (the-minjae) wrote :

I have a proposed solution, albeit rather barbarian.

The offending line (line 452 in pdb.py of Python 2.6):

       line = linecache.getline(filename, lineno, self.curframe.f_globals)

Replace the above line with the following:

        try:
            line = linecache.getline(filename, lineno, self.curframe.f_globals)
        except AttributeError:
            line = linecache.getline(filename, lineno)

Basically, the method in this madness is that when there is an error, replace it with Python 2.5 line, which does not contain lineno. This "solution" seems to do the trick for me. Please comment when this causes more problem.