docker/docker-py — pull request #393 by agy (2014-11-09 20:50:34+00:00)
Title: Ensure client version is a string.

I was bitten by specifying the Docker client version as a float rather than a string.

Example test case:

>>> import docker
>>> client = docker.Client(version=1.14)
>>> client.containers()
[]
>>> client.pull('ubuntu')
Traceback (most recent call last):
File "", line 1, in
File "docker/client.py", line 816, in pull
if utils.compare_version('1.5', self._version) >= 0:
File "docker/utils/utils.py", line 100, in compare_version
s2 = StrictVersion(v2)
File "/usr/lib/python2.7/distutils/version.py", line 40, in __init__
self.parse(vstring)
File "/usr/lib/python2.7/distutils/version.py", line 105, in parse
match = self.version_re.match(vstring)
TypeError: expected string or buffer

>>> client = docker.Client(version='1.14')
>>> client.containers()
[]
>>> client.pull('ubuntu')
u'{"status":"Pulling repository ubuntu"} [... snip ...] "id":"0b310e6bf058"}'