[Python-modules-team] Bug#767445: python-docker: throws ValueError exception on attempting any command
Felipe Sateler
fsateler at debian.org
Fri Oct 31 03:02:50 UTC 2014
Package: python-docker
Version: 0.5.3-1
Severity: grave
Justification: renders package unusable
I'm finding it impossible to do anything with the API. The ipython
backtrace is pasted below.
My python fu is relatively limited, but the problem looks like for some
reason the requests module is changing the timeout from a number to a
Timeout object, and urllib barfs. I couldn't reproduce the issue using
plain requests (ie, creating a session, adding the HttpAdapter and
sending a request), so I'm filing the bug here. If the bug is elsewhere,
please reassign as appropriate.
In [1]: from docker import Client
In [2]: c = Client()
In [3]: c.version()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-3-33a9b5269bcf> in <module>()
----> 1 c.version()
/usr/lib/python2.7/dist-packages/docker/client.pyc in version(self)
932
933 def version(self):
--> 934 return self._result(self._get(self._url("/version")), True)
935
936 def wait(self, container):
/usr/lib/python2.7/dist-packages/docker/client.pyc in _get(self, url, **kwargs)
74
75 def _get(self, url, **kwargs):
---> 76 return self.get(url, **self._set_request_timeout(kwargs))
77
78 def _delete(self, url, **kwargs):
/usr/lib/python2.7/dist-packages/requests/sessions.pyc in get(self, url, **kwargs)
467
468 kwargs.setdefault('allow_redirects', True)
--> 469 return self.request('GET', url, **kwargs)
470
471 def options(self, url, **kwargs):
/usr/lib/python2.7/dist-packages/requests/sessions.pyc in request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json)
455 }
456 send_kwargs.update(settings)
--> 457 resp = self.send(prep, **send_kwargs)
458
459 return resp
/usr/lib/python2.7/dist-packages/requests/sessions.pyc in send(self, request, **kwargs)
567
568 # Send the request
--> 569 r = adapter.send(request, **kwargs)
570
571 # Total elapsed time of the request (approximately)
/usr/lib/python2.7/dist-packages/requests/adapters.py in send(self, request, stream, timeout, verify, cert, proxies)
360 decode_content=False,
361 retries=Retry(self.max_retries, read=False),
--> 362 timeout=timeout
363 )
364
/usr/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, **response_kw)
514 httplib_response = self._make_request(conn, method, url,
515 timeout=timeout,
--> 516 body=body, headers=headers)
517
518 # If we're going to release the connection in ``finally:``, then
/usr/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _make_request(self, conn, method, url, timeout, **httplib_request_kw)
297 self.num_requests += 1
298
--> 299 timeout_obj = self._get_timeout(timeout)
300 timeout_obj.start_connect()
301 conn.timeout = timeout_obj.connect_timeout
/usr/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.pyc in _get_timeout(self, timeout)
277 # User passed us an int/float. This is for backwards compatibility,
278 # can be removed later
--> 279 return Timeout.from_float(timeout)
280
281 def _make_request(self, conn, method, url, timeout=_Default,
/usr/lib/python2.7/dist-packages/requests/packages/urllib3/util/timeout.pyc in from_float(cls, timeout)
150 :rtype: :class:`Timeout`
151 """
--> 152 return Timeout(read=timeout, connect=timeout)
153
154 def clone(self):
/usr/lib/python2.7/dist-packages/requests/packages/urllib3/util/timeout.pyc in __init__(self, total, connect, read)
93
94 def __init__(self, total=None, connect=_Default, read=_Default):
---> 95 self._connect = self._validate_timeout(connect, 'connect')
96 self._read = self._validate_timeout(read, 'read')
97 self.total = self._validate_timeout(total, 'total')
/usr/lib/python2.7/dist-packages/requests/packages/urllib3/util/timeout.pyc in _validate_timeout(cls, value, name)
123 except (TypeError, ValueError):
124 raise ValueError("Timeout value %s was %s, but it must be an "
--> 125 "int or float." % (name, value))
126
127 try:
ValueError: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float.
-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python-docker depends on:
ii python 2.7.8-2
ii python-requests 2.4.3-2
ii python-six 1.8.0-1
ii python-websocket 0.18.0-1
python-docker recommends no packages.
python-docker suggests no packages.
-- no debconf information
More information about the Python-modules-team
mailing list