summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilas Bowman <milas.bowman@docker.com>2023-02-22 12:00:47 -0500
committerGitHub <noreply@github.com>2023-02-22 12:00:47 -0500
commitf84623225e0227adde48ffd8f2e1cafb1f9aa38d (patch)
tree291a38b94d26a8577aa8b3b7f8213b4fe5ad6c90
parent7cd7458f2f41ef5af58589f28307a064936d7be1 (diff)
downloaddocker-py-f84623225e0227adde48ffd8f2e1cafb1f9aa38d.tar.gz
socket: fix for errors on pipe close in Windows (#3099)
Need to return data, not size. By returning an empty string, EOF will be detected properly since `len()` will be `0`. Fixes #3098. Signed-off-by: Milas Bowman <milas.bowman@docker.com>
-rw-r--r--docker/utils/socket.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/docker/utils/socket.py b/docker/utils/socket.py
index 5aca30b..47cb44f 100644
--- a/docker/utils/socket.py
+++ b/docker/utils/socket.py
@@ -49,7 +49,7 @@ def read(socket, n=4096):
if is_pipe_ended:
# npipes don't support duplex sockets, so we interpret
# a PIPE_ENDED error as a close operation (0-length read).
- return 0
+ return ''
raise