[PATCH 1/3] Close child fds when using subprocess

Brian C. Lane bcl at redhat.com
Thu Feb 12 00:13:21 UTC 2015


---
 src/pypungi/util.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pypungi/util.py b/src/pypungi/util.py
index 0a2ea11..800cf7f 100644
--- a/src/pypungi/util.py
+++ b/src/pypungi/util.py
@@ -24,7 +24,8 @@ def _doRunCommand(command, logger, rundir='/tmp', output=subprocess.PIPE, error=
 
     logger.info("Running %s" % subprocess.list2cmdline(command))
 
-    p1 = subprocess.Popen(command, cwd=rundir, stdout=output, stderr=error, universal_newlines=True, env=env)
+    p1 = subprocess.Popen(command, cwd=rundir, stdout=output, stderr=error, universal_newlines=True, env=env,
+                          close_fds=True)
     (out, err) = p1.communicate()
 
     if out:
-- 
2.1.0



More information about the buildsys mailing list