"file" does not work with the "with" statement!

Michele Simionato michele.simionato at gmail.com
Thu Dec 10 06:59:31 EST 2009


On Dec 10, 11:59 am, Christian Heimes <li... at cheimes.de> wrote:
> In Python 2.5 you have to implement your own __enter__ and __exit__
> methods if you subclass from file. The file.__exit__ function doesn't
> call f.close().

Yes, that was my problem.



More information about the Python-list mailing list