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.

classification
Title: Redundant connect() call in logging.handlers.SysLogHandler
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: vinay.sajip Nosy List: kenlalonde, vinay.sajip
Priority: normal Keywords: patch

Created on 2005-11-07 20:14 by kenlalonde, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch.txt kenlalonde, 2005-11-07 20:14 Patch to Lib/logging/handlers.py
Messages (4)
msg48986 - (view) Author: Ken Lalonde (kenlalonde) Date: 2005-11-07 20:14
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.
msg48987 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2005-11-08 13:41
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.
msg48988 - (view) Author: Ken Lalonde (kenlalonde) Date: 2005-11-08 17:34
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.
msg48989 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2005-11-09 13:59
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.
History
Date User Action Args
2022-04-11 14:56:13adminsetgithub: 42566
2005-11-07 20:14:49kenlalondecreate