diff --git a/cocluto/Util.py b/cocluto/Util.py index 7831eae..037872f 100644 --- a/cocluto/Util.py +++ b/cocluto/Util.py @@ -46,7 +46,7 @@ def log(message): def executeProgram(astrArguments): # log('executeProgram : program [%s]' % (','.join(astrArguments))) - popen = subprocess.Popen( astrArguments, bufsize=1, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # bufsize=1 seems to prevent deadlocks that happen 50% the time + popen = subprocess.Popen( astrArguments, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # bufsize=1 seems to prevent deadlocks that happen 50% the time stdout, stderr = popen.communicate() # popen.wait() result = (popen.returncode, stdout.decode(), stderr) @@ -59,7 +59,7 @@ def executeCommand(command): """ executes the shell command such as 'set x=1; myprog $x' """ - popen = subprocess.Popen( [command], bufsize=1, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, executable='/bin/bash') # bufsize=1 seems to prevent deadlocks that happen 50% the time + popen = subprocess.Popen( [command], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, executable='/bin/bash') # bufsize=1 seems to prevent deadlocks that happen 50% the time # if we don't specify the optional executable argument, then the default non interactive shell will be used. On debian, the default non-interactive shell is dash, which doesn't understand the keyword 'source' that we use in many places stdout, stderr = popen.communicate() # popen.wait()