File not closed on exception

arve.knudsen at arve.knudsen at
Tue Oct 20 20:31:21 CEST 2009

On 20 Okt, 16:00, Bruno Desthuilliers <bruno.
42.desthuilli... at websiteburo.invalid> wrote:
> What's your problem with the with ???

No problem whatsoever, but I believe I wrote this utility function
before the keyword was available, and it might be good to support
older Python versions.

> But anyway : explicitely releasing resources such as files, network
> connections etc is of course the RightThing(tm), except eventually in
> one-shot throwaway scripts.
> > However, when providing a patch for a
> > high-profile opensource Python project I was scolded for going to such
> > lengths, as the prescribed style was to just open files and let them
> > be closed implicitly.
> Err... Care to name the project ? I hope it's not one I ever advertized :(

I'm not going to name the project, but it is incidentally used by the
Python project itself :)


More information about the Python-list mailing list