Peter Creath <pjcreath+pyt...@gmail.com> added the comment: Thank you for clarifying the documentation. However, I don't think that fully resolves the issue.
I'm not complaining about a failure to close the file. As you observe, it doesn't need to (and shouldn't) close a file object, but it should release the reference. The code already tries to release the reference ("self._file = None"). It just fails to release it correctly, missing the other reference to the file object (self._data_chunk). That's the bug. Your clarification of the documentation is appreciated nonetheless. I've attached a patch as Ned requested. The same patch can currently be applied to release27-maint, release31-maint, and py3k. (The line numbers and surrounding context are identical.) ---------- keywords: +patch resolution: fixed -> status: closed -> open versions: +Python 2.5, Python 2.6, Python 3.1 Added file: http://bugs.python.org/file20374/issue10855.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10855> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com