[Python-checkins] cpython (2.7): Issue #15179: Closed socket on connection failure. Thanks to Kazutaka Morita
vinay.sajip
python-checkins at python.org
Tue Jun 26 00:20:38 CEST 2012
http://hg.python.org/cpython/rev/99f0c0207faa
changeset: 77783:99f0c0207faa
branch: 2.7
parent: 77776:723dbf99f9c2
user: Vinay Sajip <vinay_sajip at yahoo.co.uk>
date: Mon Jun 25 23:17:07 2012 +0100
summary:
Issue #15179: Closed socket on connection failure. Thanks to Kazutaka Morita for the patch.
files:
Lib/logging/handlers.py | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -771,7 +771,11 @@
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
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list