[issue10855] wave.Wave_read.close() doesn't release file

Peter Creath report at bugs.python.org
Wed Jan 12 16:32:09 CET 2011


Peter Creath <pjcreath+python at 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 <report at bugs.python.org>
<http://bugs.python.org/issue10855>
_______________________________________


More information about the Python-bugs-list mailing list