Bugs item #760475, was opened at 2003-06-25 06:11
Message generated for change (Comment added) made by josiahcarlson
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=760475&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jes�s Cea Avi�n (jcea)
Assigned to: Josiah Carlson (josiahcarlson)
Summary: asyncore.py and "handle_error"

Initial Comment:
When an uncached exception arises in "asyncore", the
method "handle_error" is called. This method calls
"self.close()" when it MUST call "self.handle_close()",
in order to support correctly the "delegation" design
pattern, for example.



----------------------------------------------------------------------

>Comment By: Josiah Carlson (josiahcarlson)
Date: 2007-01-06 15:02

Message:
Logged In: YES 
user_id=341410
Originator: NO

While the default .close() method is called inside .handle_close(), not
calling .handle_close() in asyncore prevents any subclassed .handle_close()
behavior to be run.

Say, for example, that a user has written a subclass where within
.handle_connect() the socket is registered somewhere (perhaps for I/O
statistics in an FTP or Bittorrent application).  Where it would make sense
to place the unregistration code is within a .handle_close() method, which
is bypassed by the standard .handle_error() code.

I suggest switching to the self.handle_close() call at the end of
handle_error() .  Doing so preserves the passing of the test suite on
release 2.5 on Windows.

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2003-06-25 11:11

Message:
Logged In: YES 
user_id=31392

Can you expand on your comments.  I don't know what the
delegation design pattern you refer to is.  Can you provide
an example of why it is necessary that asyncore not call
close()?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=760475&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to