This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients François-Xavier.Bourlet, neologix, xdegaye
Date 2011-10-30.18:43:24
SpamBayes Score 3.2596148e-13
Marked as misclassified No
Message-id <CAH_1eM0tzYpbocux-rDGiwiyTWquvGzOte6tW2F2ywa-3OZZww@mail.gmail.com>
In-reply-to <1319997748.61.0.676793938656.issue12498@psf.upfronthosting.co.za>
Content
> 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 ;-)
History
Date User Action Args
2011-10-30 18:43:24neologixsetrecipients: + neologix, xdegaye, François-Xavier.Bourlet
2011-10-30 18:43:24neologixlinkissue12498 messages
2011-10-30 18:43:24neologixcreate