diff options
author | Joffrey F <joffrey@docker.com> | 2018-06-05 10:51:54 -0700 |
---|---|---|
committer | Joffrey F <f.joffrey@gmail.com> | 2018-06-06 17:53:50 -0700 |
commit | dbe52dcb7d5765352faa43ab0210fddbcb546431 (patch) | |
tree | 81fc2e6bae8ea6e82a4e8e49a55709dd669506c0 /docker/utils | |
parent | 49bb7386a3a3752dca64b411a6996663ed04ea1e (diff) | |
download | docker-py-dbe52dcb7d5765352faa43ab0210fddbcb546431.tar.gz |
Fix socket reading function for TCP (non-HTTPS) connections on Windows
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker/utils')
-rw-r--r-- | docker/utils/socket.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docker/utils/socket.py b/docker/utils/socket.py index 0945f0a..7b96d4f 100644 --- a/docker/utils/socket.py +++ b/docker/utils/socket.py @@ -1,6 +1,7 @@ import errno import os import select +import socket as pysocket import struct import six @@ -28,6 +29,8 @@ def read(socket, n=4096): try: if hasattr(socket, 'recv'): return socket.recv(n) + if six.PY3 and isinstance(socket, getattr(pysocket, 'SocketIO')): + return socket.read(n) return os.read(socket.fileno(), n) except EnvironmentError as e: if e.errno not in recoverable_errors: |