From 41f9ef4f6c277ce7b68e1b30c82e77c2507eec68 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Wed, 8 Jul 2015 07:48:09 +0200 Subject: [PATCH] Close file descriptors when calling a script. --- src/formconfig.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/formconfig.py b/src/formconfig.py index 4eadea7..ca20c83 100644 --- a/src/formconfig.py +++ b/src/formconfig.py @@ -96,7 +96,8 @@ class FormConfig(object): proc = subprocess.Popen(form.script, shell=True, stdout=stdout, stderr=stderr, - env=env) + env=env, + close_fds=True) stdout, stderr = proc.communicate(input) return proc.returncode else: @@ -104,7 +105,8 @@ class FormConfig(object): stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - env=env) + env=env, + close_fds=True) stdout, stderr = proc.communicate() return { 'stdout': stdout,