[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. eda668423fa87898c59d1075118693714aa5a053
Andreas Beckmann
debian at abeckmann.de
Fri Dec 23 10:25:52 UTC 2011
The following commit has been merged in the master branch:
commit 4e19a2232f7508ededcf9fe62c0437ebeaa2029d
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Sun Nov 20 01:07:47 2011 +0100
redirect stdin from /dev/null
when running commands in the chroot, redirect stdin from /dev/null
this is a preparation for getting rid of subprocess.Popen.communicate()
using stdin=None causes some scripts to block on read()
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/piuparts.py b/piuparts.py
index bf8866f..69dd75b 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -381,9 +381,11 @@ def run(command, ignore_errors=False):
env["LC_ALL"] = "C"
env["LANGUAGES"] = ""
env["PIUPARTS_OBJECTS"] = ' '.join(str(vobject) for vobject in settings.testobjects )
- p = subprocess.Popen(command, env=env, stdin=subprocess.PIPE,
+ devnull = open('/dev/null', 'r')
+ p = subprocess.Popen(command, env=env, stdin=devnull,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
(output, _) = p.communicate()
+ devnull.close()
if output:
dump("\n" + indent_string(output.rstrip("\n")))
--
piuparts git repository
More information about the Piuparts-commits
mailing list