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

Ville Vainio vivainio at gmail.com
Mon Jan 16 13:15:32 CST 2006


On 1/16/06, Fernando Perez <Fernando.Perez at colorado.edu> wrote:

> 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:

Done, it works, in svn.

> 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).

Actually, CPython does, Jython doesn't. There are so much CPython
dependencies anyway that it's probably safe to assume it...

--
Ville Vainio - http://tinyurl.com/2prnb
http://vainio.blogspot.com




More information about the IPython-dev mailing list