[IPython-user] .py file stuck open?

Fernando Perez Fernando.Perez at colorado.edu
Wed May 18 23:33:45 CDT 2005


D Brown wrote:
> Hi,
> 
> I'm seeing a problem using ipython where my .py source file
> cannot be saved after I get a runtime error.  Not sure if
> this is expected or not.  It's occurring after I get an
> error within the shutil module.  I don't think I've seen it
> happen so far with errors in other places.
[...]
> Any ideas on what's happening?  If I exit ipython I can
> then save the .py file again, so it appears ipython is
> holding the file open.

Mmh, I've certainly not seen this under *nix, but I know that win32 has very 
different locking behavior than *nix, and I'm afraid I'm not sure what the 
solution should be.  Any win32 experts who can suggest a good solution?

I should note that %run is little more than a safe wrapper, with nicer 
exception handling and all the fancy namespace switches, around the builtin 
execfile().

The first thing I'd try is to see whether using a plain 
execfile('yourfile.py') causes the same behavior.  If it does, I'm afraid it 
won't be easy for me to help there, unless you can find a flag or trick to 
cure the problem manually.  If you do, by all means please post your solution, 
and I can stuff it in the right place in the ipython library.

Regards,

f




More information about the IPython-user mailing list