aparo/pyes — Issue #149: Incorrect use of urlunsplit in ES._dump_curl_request?
Author: bsterne
Created: 2012-01-09 05:41:19+00:00
State: open

When urlunsplit gets called it winds up generating a TypeError because it passes a tuple, ("http", "127.0.0.1", "9200"), as the netloc argument.

Traceback (most recent call last):
File "", line 1, in
...
File "/usr/lib/python2.6/dist-packages/pyes/es.py", line 667, in open_index
return self._send_request('POST', "/%s/_open" % index)
File "/usr/lib/python2.6/dist-packages/pyes/es.py", line 413, in _send_request
self._dump_curl_request(request)
File "/usr/lib/python2.6/dist-packages/pyes/es.py", line 484, in _dump_curl_request
url = urlunsplit(('http', self.servers[0], request.uri, urlencode(params), ''))
File "/usr/lib/python2.6/urlparse.py", line 191, in urlunsplit
url = '//' + (netloc or '') + url
TypeError: cannot concatenate 'str' and 'tuple' object

This was introduced in #137. Are you sure that code is correct?