diff --git a/elasticsearch/client/utils.py b/elasticsearch/client/utils.py index 0c86cd22..9d009932 100644 --- a/elasticsearch/client/utils.py +++ b/elasticsearch/client/utils.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import weakref from datetime import date, datetime from functools import wraps -from ..compat import string_types, quote_plus, PY2 +from ..compat import string_types, quote, PY2 # parts of URL to be omitted SKIP_IN_PATH = (None, "", b"", [], ()) @@ -49,7 +49,7 @@ def _make_path(*parts): # TODO: maybe only allow some parts to be lists/tuples ? return "/" + "/".join( # preserve ',' and '*' in url for nicer URLs in logs - quote_plus(_escape(p), b",*") + quote(_escape(p), b",*") for p in parts if p not in SKIP_IN_PATH ) diff --git a/elasticsearch/compat.py b/elasticsearch/compat.py index 247c5d6e..bcee5f6a 100644 --- a/elasticsearch/compat.py +++ b/elasticsearch/compat.py @@ -10,7 +10,7 @@ if PY2: from Queue import Queue else: string_types = str, bytes - from urllib.parse import quote_plus, urlencode, urlparse, unquote + from urllib.parse import quote, quote_plus, urlencode, urlparse, unquote map = map from queue import Queue