File 0001-AWSHTTPSConnection-invoke-the-correct-constructor.patch of Package python-botocore

From ac5cf81e854b6c1aa77f38f8c934c96d859f6c39 Mon Sep 17 00:00:00 2001
From: Felipe Sateler <fsateler@users.noreply.github.com>
Date: Mon, 7 Aug 2017 11:23:08 -0400
Subject: [PATCH] AWSHTTPSConnection: invoke the correct constructor

Fixes #1258
---
 botocore/awsrequest.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/botocore/awsrequest.py b/botocore/awsrequest.py
index c26ebc077..f3c5b3317 100644
--- a/botocore/awsrequest.py
+++ b/botocore/awsrequest.py
@@ -250,14 +250,26 @@ def _is_100_continue_status(self, maybe_status_line):
 
 
 class AWSHTTPSConnection(VerifiedHTTPSConnection):
-    pass
+    def __init__(self, *args, **kwargs):
+        VerifiedHTTPSConnection.__init__(self, *args, **kwargs)
+        self._original_response_cls = self.response_class
+        # We'd ideally hook into httplib's states, but they're all
+        # __mangled_vars so we use our own state var.  This variable is set
+        # when we receive an early response from the server.  If this value is
+        # set to True, any calls to send() are noops.  This value is reset to
+        # false every time _send_request is called.  This is to workaround the
+        # fact that py2.6 (and only py2.6) has a separate send() call for the
+        # body in _send_request, as opposed to endheaders(), which is where the
+        # body is sent in all versions > 2.6.
+        self._response_received = False
+        self._expect_header_set = False
 
 
 # Now we need to set the methods we overrode from AWSHTTPConnection
 # onto AWSHTTPSConnection.  This is just a shortcut to avoid
 # copy/pasting the same code into AWSHTTPSConnection.
 for name, function in AWSHTTPConnection.__dict__.items():
-    if inspect.isfunction(function):
+    if inspect.isfunction(function) and function.__name__ != '__init__':
         setattr(AWSHTTPSConnection, name, function)
 
 
openSUSE Build Service is sponsored by