[IPython-user] Cannot %run -d file.py -- error with pdb and curframe

Minjae Kim the.minjae@gmail....
Wed May 27 01:18:44 CDT 2009


Hello,

This error has been previously reported before, but I could not find a
documented answer.
I am using Python 2.6.2 and tried both IPython 0.9 and 0.10 (nightly build)

I have a python file, say, file.py.  I am trying to step through it using
the debugger,
so I want to do  %run -d file.py.  But I get the following error



---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)

/home/m/Desktop/<ipython console> in <module>()

/usr/local/lib/python2.6/dist-packages/IPython/iplib.pyc in ipmagic(self,
arg_s)
   1180         else:
   1181             magic_args = self.var_expand(magic_args,1)
-> 1182             return fn(magic_args)
   1183
   1184     def ipalias(self,arg_s):

/usr/local/lib/python2.6/dist-packages/IPython/Magic.pyc in magic_run(self,
parameter_s, runner, file_finder)
   1631                     maxtries = 10
   1632                     bp = int(opts.get('b',[1])[0])
-> 1633                     checkline = deb.checkline(filename,bp)
   1634                     if not checkline:
   1635                         for bp in range(bp+1,bp+maxtries+1):

/usr/lib/python2.6/pdb.pyc in checkline(self, filename, lineno)
    450         line or EOF). Warning: testing is not comprehensive.
    451         """
--> 452         line = linecache.getline(filename, lineno,
self.curframe.f_globals)
    453         if not line:
    454             print >>self.stdout, 'End of file'

AttributeError: Pdb instance has no attribute 'curframe'




I know of no way around this.  I just want to set some breakpoints manually
at designated lines like "break 5", but I don't want to modify the file to
artificially introduce errors.

Any help to solve the error or work around it will be greatly appreciated.

Thanks.

Minjae
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20090526/f1f28ac7/attachment.html 


More information about the IPython-user mailing list