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.