[issue11453] asyncore.file_wrapper should implement __del__ and call close there to prevent resource leaks and behave like socket.socket does.

Aldona Majorek report at bugs.python.org
Wed Mar 9 20:29:53 CET 2011


New submission from Aldona Majorek <python at ada.majorek.org>:

asyncore.file_wrapper duplicates file descriptor of given file and closes it in it's close method.

But unlike socket.socket class it does not automatically call close when object is garbage collected.

Users of regular sockets and asyncore.dispatcher do not experience resource leaks when they forget to call self.close() in handle_close().

But people using file_dispatcher do loose file descriptor every time file_wrapper object is garbage collected without calling self.close() first.

----------
components: Library (Lib)
messages: 130458
nosy: amajorek
priority: normal
severity: normal
status: open
title: asyncore.file_wrapper should implement __del__ and call close there to prevent resource leaks and behave like socket.socket does.
type: resource usage
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11453>
_______________________________________


More information about the Python-bugs-list mailing list