From 3c4d50f8a52406ee3a8847a0b2685363bd2f6422 Mon Sep 17 00:00:00 2001 From: Milas Bowman Date: Thu, 16 Feb 2023 13:58:35 -0500 Subject: [PATCH] socket: fix for errors on pipe close in Windows 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 --- docker/utils/socket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/utils/socket.py b/docker/utils/socket.py index 5aca30b17d..47cb44f62f 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