[IPython-dev] [Fwd: IPython 0.7 - possible bug with "%edit -p"]

Fernando Perez Fernando.Perez at colorado.edu
Mon Jan 16 12:52:52 CST 2006


Ville Vainio wrote:
> On 1/16/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:
> 
>>Bug report from a user - I'm forwarding it just so it's recorded here and we
>>don't miss it.  I told him not to bother with filing on the tracker, as this
>>should get taken are of soon by me or Ville, before the 0.7.1 bugfix release.
> 
> 
> I guess we'll need to revert to the old %edit functionality, this is
> the same problem as with Alexander Belchenko. I'll take it.

Yes, it's the same problem.  Thanks for looking into it.  Reverting to the old:

         if use_temp:
	            contents = file(filename).read()
  	            return contents

should be enough, though that code should read instead:

if use_temp:
     return file_read(filename)

This uses file_read from genutils, which guarantees closing the file object 
(which Python doesn't automatically enforce on file objects which go out of 
scope).

Cheers,

f




More information about the IPython-dev mailing list