From 170b9c67090199b17708511213a517cff1ee7be9 Mon Sep 17 00:00:00 2001 From: Honza Kral Date: Wed, 10 Jul 2013 14:07:01 +0200 Subject: [PATCH] Make sure to serialize numbers in url properly --- elasticsearch/client/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/elasticsearch/client/utils.py b/elasticsearch/client/utils.py index f73648f9..3c2b1b7c 100644 --- a/elasticsearch/client/utils.py +++ b/elasticsearch/client/utils.py @@ -16,8 +16,10 @@ def _escape(part): """ if isinstance(part, (list, tuple)): part = ','.join(part) - # mark ',' as safe for nicer url in logs - return quote_plus(part, ',') + if isinstance(part, (type(''), type(u''))): + # mark ',' as safe for nicer url in logs + return quote_plus(part, ',') + return str(part) def _make_path(*parts): """