From c7d53b42191e804c14f7bf2f1734092f76873686 Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Thu, 23 Jan 2014 11:34:32 -0500 Subject: [PATCH] Use subprocess.STDOUT, rather than sys.STDOUT to rebind stderr --- i18n/execute.py | 4 ++-- i18n/validate.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/execute.py b/i18n/execute.py index 43bdec2deb..e7c2465338 100644 --- a/i18n/execute.py +++ b/i18n/execute.py @@ -11,7 +11,7 @@ def execute(command, working_directory=BASE_DIR): Output is ignored. """ LOG.info(command) - subprocess.check_call(command, cwd=working_directory, stderr=sys.STDOUT, shell=True) + subprocess.check_call(command, cwd=working_directory, stderr=subprocess.STDOUT, shell=True) def call(command, working_directory=BASE_DIR): @@ -22,7 +22,7 @@ def call(command, working_directory=BASE_DIR): """ LOG.info(command) - p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=working_directory) + p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=working_directory, shell=True) out, err = p.communicate() return (out, err) diff --git a/i18n/validate.py b/i18n/validate.py index c9ea20a5d6..967a9eab82 100644 --- a/i18n/validate.py +++ b/i18n/validate.py @@ -39,7 +39,7 @@ def msgfmt_check_po_file(filename): """ # Use relative paths to make output less noisy. rfile = os.path.relpath(filename, LOCALE_DIR) - out, err = call(['msgfmt', '-c', rfile], working_directory=LOCALE_DIR) + out, err = call('msgfmt -c {}'.format(rfile), working_directory=LOCALE_DIR) if err != '': log.info('\n' + out) log.warn('\n' + err)