[IPython-user] Fail to reload file on %run

Joachim B Haga cjhaga at fys.uio.no
Wed Jun 21 14:56:40 CDT 2006


I just started using ipython (0.7.1 on ubuntu, 0.7.2 on debian),
and I have this problem: the %run command fails to pick up changes
to the source file. According to the documentation, the new version
of the file should be run but it seems that it isn't. Although the
stack trace shows the new version, the error is from the old.

Example:
  --------------------------------
  In [1]: %run PmtReader.py
  ...snip...
  /home/jbh/src/PmtReader.py in open(self)
       32     def open (self):
       33         """Open the requested file"""
  ---> 34         self.f = open(self.getFilePath(),'r')
       35         self.isopen = True;
       36 

  IOError: [Errno 2] No such file or directory: 'ggxy.pmt'
  --------------------------------

I then change the source file to remove the offending statement, 
but the error remains the same (note the misleading trace):

  --------------------------------
  In [2]: %run PmtReader.py
  ...snip...
  /home/jbh/src/PmtReader.py in open(self)
       32     def open (self):
       33         """Open the requested file"""
  ---> 34         return
       35 
       36     def close (self):

  IOError: [Errno 2] No such file or directory: 'ggxy.pmt'
  --------------------------------

So... is this an unknown bug (in which case I'll try to create
a proper testcase), or is it a known weakness?


-j.




More information about the IPython-user mailing list