[Patches] [ python-Patches-1350658 ] Redundant connect() call in logging.handlers.SysLogHandler

SourceForge.net noreply at sourceforge.net
Wed Nov 9 14:59:32 CET 2005


Patches item #1350658, was opened at 2005-11-07 20:14
Message generated for change (Comment added) made by vsajip
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1350658&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: Library (Lib)
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Ken Lalonde (kenlalonde)
Assigned to: Vinay Sajip (vsajip)
Summary: Redundant connect() call in logging.handlers.SysLogHandler

Initial Comment:
Visual inspection of _connect_unixsocket() in
Lib/logging/handlers.py
shows that, in the absence of an exception, a DGRAM
socket will always be connected twice.  This is likely
harmless, but also pointless.

The attached patch against today's CVS simply omits the
second connect() call.

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

>Comment By: Vinay Sajip (vsajip)
Date: 2005-11-09 13:59

Message:
Logged In: YES 
user_id=308438

Sorry, I didn't look at the patch - I just looked at your
comment.

The fix is now checked into the Subversion repository.
Thanks for the patch.

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

Comment By: Ken Lalonde (kenlalonde)
Date: 2005-11-08 17:34

Message:
Logged In: YES 
user_id=203927

Thanks for the quick response.
Perhaps my original post was unclear,
but the patch I included does precisely as you suggest:
it indents the second call.

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

Comment By: Vinay Sajip (vsajip)
Date: 2005-11-08 13:41

Message:
Logged In: YES 
user_id=308438

The bug is valid but the patch is not :-( The exception
clause tries to open a TCP socket and this needs to be
connected. So the correct fix (I think) is to indent the
second connect() call. I will check the change into SVN later.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1350658&group_id=5470


More information about the Patches mailing list