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
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.dispatch
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