Skip to content

Commit

Permalink
socket: fix for errors on pipe close in Windows (#3099)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
milas authored Feb 22, 2023
1 parent 7cd7458 commit f846232
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/utils/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit f846232

Please sign in to comment.