[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. eda668423fa87898c59d1075118693714aa5a053

Holger Levsen holger at layer-acht.org
Fri Dec 23 10:26:19 UTC 2011


The following commit has been merged in the master branch:
commit 47b52afe9bc94718110bfdd4b76b743c3533b9e0
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 1de475b..7924c1e 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