From 7e24a996d8a80395ac04c4246c8c12e7102c3971 Mon Sep 17 00:00:00 2001 From: whisperstream Date: Fri, 10 Jul 2015 15:52:18 -0700 Subject: [PATCH] fix for Splunk Support Case: 204977 --- splunklib/binding.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/splunklib/binding.py b/splunklib/binding.py index c70096287..ff48d2804 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -1231,7 +1231,10 @@ def request(url, message, **kwargs): if timeout is not None: connection.sock.settimeout(timeout) response = connection.getresponse() - finally: + ### fix for Splunk Support Case: 204977 + ### this removes the "finally" keyword, which automatically closed the connection, making + ### it impossible to use the reader object on line 763 above (because the connection had been closed here. + except: connection.close() return {