From c387b9dce2fb6a7f320de9e3f1823f88042087cf Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Tue, 23 May 2023 11:35:15 +0200 Subject: [PATCH] fixed warning 'RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used' work related to Bug 3315 - make simpaweb django app a packageable application --- cocluto/Util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()