The current version of python shipped with CentOS 6.5 already includes the fix (or rather a work around):
$ cat python-2.6.6-fix-SysLogHandler-error-handling.patch diff -up Python-2.6.6/Lib/logging/handlers.py.15179 Python-2.6.6/Lib/logging/handlers.py --- Python-2.6.6/Lib/logging/handlers.py.15179 2010-05-24 05:43:13.000000000 -0400 +++ Python-2.6.6/Lib/logging/handlers.py 2012-10-11 20:45:18.849380832 -0400 @@ -727,7 +727,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
The current version of python shipped with CentOS 6.5 already includes the fix (or rather a work around):
$ cat python- 2.6.6-fix- SysLogHandler- error-handling. patch 2.6.6/Lib/ logging/ handlers. py.15179 Python- 2.6.6/Lib/ logging/ handlers. py 2.6.6/Lib/ logging/ handlers. py.15179 2010-05-24 05:43:13.000000000 -0400 2.6.6/Lib/ logging/ handlers. py 2012-10-11 20:45:18.849380832 -0400 logging. Handler) :
self. socket. close()
self. socket = socket. socket( socket. AF_UNIX, socket.SOCK_STREAM) connect( address) connect( address)
diff -up Python-
--- Python-
+++ Python-
@@ -727,7 +727,11 @@ class SysLogHandler(
except socket.error:
- self.socket.
+ try:
+ self.socket.
+ 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