From 1d51baf77090bae1afb98016831a95c9b050ae2e Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Wed, 7 Jul 2010 14:22:44 +0100 Subject: [PATCH] Fix race condition in our commands.getstatusoutput monkeypatch Previously we were returning from this method before the process had actually finished, introducing issues where we relied on process actually finishing or simply not returning all the data the process was going to produce. --- daklib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daklib/utils.py b/daklib/utils.py index 0896d578..5c716470 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -70,7 +70,7 @@ def dak_getstatusoutput(cmd): pipe = subprocess.Popen(cmd, shell=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - output = "".join(pipe.stdout.readlines()) + output, _ = pipe.communicate() if output[-1:] == '\n': output = output[:-1] -- 2.39.5