Author jso2460
Recipients eamanu, jso2460
Date 2018-12-27.11:22:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Yes, when timeout occurs it's then caught by the OSError -- you are completely right about that.

Instead my suggestion was meant to provide an option to specify a timeout when creating an instance of SysLogHandler. Currently the socket is created with default timeout (which is AFAIK set via socket.setdefaulttimeout though this applies to the whole module and effectively affects other sockets created).

In my particular use case I have the SysLog settings user-configurable, and thus sometimes it gets misconfigured. Then it is annoying to wait for a default timeout.. and there seem no way to specify the particular timeout when creating the handler. 
(Not speaking of the fact that SysLogHandler connects right away in __init__ call which I don't consider very reasonable but that would be a different story.)

Therefore I suggest to either add new argument for timeout (as the example in my comment above), or to wrap the socket creation into a method/function which an extending class could extend/implement, e.g. by changing:

sock = socket.socket(af, socktype, proto)
if socktype == socket.SOCK_STREAM:


def _create_socket(af, socktype, proto): # or adding *args, **kwargs?
    socket.socket(af, socktype, proto)

sock = create_socket(af, socktype, proto) 
if socktype == socket.SOCK_STREAM:

By the way, thanks for marking the issue as enhancement. Kind of missed that when creating the issue at first.
Date User Action Args
2018-12-27 11:22:59jso2460setrecipients: + jso2460, eamanu
2018-12-27 11:22:56jso2460setmessageid: <>
2018-12-27 11:22:56jso2460linkissue35590 messages
2018-12-27 11:22:56jso2460create