[issue11453] asyncore.file_wrapper should implement __del__ and call close there to prevent resource leaks and behave like socket.socket does.
Aldona Majorek added the comment: Adding __exit__ will not make asyncore.file_wrapper close file descriptor when garbage collected. Here is clone of socket.py solution for the same problem. def close(self): if self.fd: os.close(self.fd) self.fd = None # or maybe self.fd = 0 will be better def __del__(self): try: self.close() except: # close() may fail if __init__ didn't complete pass -- ___ Python tracker <http://bugs.python.org/issue11453> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11453] asyncore.file_wrapper should implement __del__ and call close there to prevent resource leaks and behave like socket.socket does.
New submission from Aldona Majorek : 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 <http://bugs.python.org/issue11453> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3127] Segfault provoked by generators and exceptions
New submission from Aldona Majorek <[EMAIL PROTECTED]>: Copy of issue 1579370 Programs using generators, exceptions and threads could crash. I was not able to make plain python program to crash, but python program embedded in C++ crashed very reliably. No more crashes after applying patch from 2.5 version stopped helped. I verified that bug and patch on python 2.4.3. Looking at the source code in svn, the same but lurks in latest 2.3 and 2.2 (since generators were introduced). -- components: Interpreter Core messages: 68303 nosy: amajorek, awaters, eric_noyau, klaas, loewis, mwh, nnorwitz, tim_one severity: normal status: open title: Segfault provoked by generators and exceptions type: crash versions: Python 2.2.3, Python 2.3, Python 2.4 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3127> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com