Filip Gruszczyński <gruszczy at gmail.com> added the comment: Oh, I haven't noticed that. Using contextlib.closing solves my problem. Thanks. ---------- _______________________________________ Python tracker <report at bugs.python.org> <http://bugs.python.org/issue13896> _______________________________________