From a6dd4ddbceca69350c16fc8c0a2ead22894f1708 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 18 Aug 2021 13:32:34 +0100 Subject: [PATCH] ssh: Flush writing end of pipes before closing When running a background command, ensure the redirection thread flushes the writing end of the pipe before closing it. --- devlib/utils/ssh.py | 1 + 1 file changed, 1 insertion(+) diff --git a/devlib/utils/ssh.py b/devlib/utils/ssh.py index 5856354..6d6bfc5 100644 --- a/devlib/utils/ssh.py +++ b/devlib/utils/ssh.py @@ -678,6 +678,7 @@ class SshConnection(SshConnectionBase): # Make sure the writing end are closed proper since we are not # going to write anything anymore for r, w in out_streams.values(): + w.flush() if r is not w and w is not None: w.close()