Charles-François Natali <[email protected]> added the comment:
> While writing the test case, I found out that the test case does not
> fail before the patch. It seems that draining the output buffer
> already works:
>
> The attached script 'asyncore_shutdown.py' drains the output buffer
> when run without the patch, with Python 3.2, and prints 'Done.'. The
> dispatcher_with_send handle_close() method is never called.
That's because you didn't define a handle_read() method: since you
never read from the socket, you don't detect EOF, and never call
handle_close():
Try with this:
"""
print('Done.')
self.close()
+ def handle_read(self):
+ self.recv(MSG_SIZE)
+
def handle_close(self):
print('calling handle_close')
asyncore.dispatcher_with_send.handle_close(self)
"""
And it'll fail ;-)
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue12498>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com