Skip to content

Commit 3f7be47

Browse files
Wynndowfxdgear
authored andcommitted
Bump version to 5.5.4
1 parent fe7b4de commit 3f7be47

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

Changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Changelog
44
=========
55

6+
5.5.4 (2018-06-20)
7+
------------------
8+
* Pass retry object instead of False to urllib3
9+
610
5.5.3 (2018-06-20)
711
------------------
812

elasticsearch5/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
22

3-
VERSION = (5, 5, 3)
3+
VERSION = (5, 5, 4)
44
__version__ = VERSION
55
__versionstr__ = '.'.join(map(str, VERSION))
66

elasticsearch5/connection/http_urllib3.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import time
22
import urllib3
33
from urllib3.exceptions import ReadTimeoutError, SSLError as UrllibSSLError
4+
from urllib3.util.retry import Retry
45
import warnings
56

67
CA_CERTS = None
@@ -112,7 +113,19 @@ def perform_request(self, method, url, params=None, body=None, timeout=None, ign
112113
if not isinstance(method, str):
113114
method = method.encode('utf-8')
114115

115-
response = self.pool.urlopen(method, url, body, retries=False, headers=self.headers, **kw)
116+
request_headers = self.headers
117+
if headers:
118+
request_headers = request_headers.copy()
119+
request_headers.update(headers)
120+
if self.http_compress and body:
121+
try:
122+
body = gzip.compress(body)
123+
except AttributeError:
124+
# oops, Python2.7 doesn't have `gzip.compress` let's try
125+
# again
126+
body = gzip.zlib.compress(body)
127+
128+
response = self.pool.urlopen(method, url, body, retries=Retry(False), headers=request_headers, **kw)
116129
duration = time.time() - start
117130
raw_data = response.data.decode('utf-8')
118131
except Exception as e:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup, find_packages
44
import sys
55

6-
VERSION = (5, 5, 3)
6+
VERSION = (5, 5, 4)
77
__version__ = VERSION
88
__versionstr__ = '.'.join(map(str, VERSION))
99

0 commit comments

Comments
 (0)