Skip to content

Commit 08cd010

Browse files
author
Timothee Besset
committed
Close urllib3 Response objects. Fixes occasional exceptions "ValueError: I/O operation on closed file." at shutdown.
Signed-off-by: Timothee Besset <ttimo@ttimo.net>
1 parent 6e6a273 commit 08cd010

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

docker/api/exec_api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,5 @@ def exec_start(self, exec_id, detach=False, tty=False, stream=False,
173173
if stream:
174174
return CancellableStream(output, res)
175175
else:
176+
res.close()
176177
return output

docker/types/daemon.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,5 @@ def close(self):
6969

7070
sock.shutdown(socket.SHUT_RDWR)
7171
sock.close()
72+
73+
self._response.close()

0 commit comments

Comments
 (0)