--- Lib/logging/handlers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -742,7 +742,11 @@ class SysLogHandler(logging.Handler): except socket.error: self.socket.close() self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - self.socket.connect(address) + try: + self.socket.connect(address) + except socket.error: + self.socket.close() + raise # curious: when talking to the unix-domain '/dev/log' socket, a # zero-terminator seems to be required. this string is placed