From 28a2f9b9951fb3e1f23c67d1192e5ca9e44d61e2 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 26 Apr 2016 10:52:14 +1000 Subject: [PATCH] Fix python3 parsing of subprocess output As described in the python docs, use "universal_newlines" to subprocess so the output are text streams. With this, tox -e py34 works Change-Id: I79091ed98054f25414d99824ee686bdf38ab968e --- bashate/bashate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bashate/bashate.py b/bashate/bashate.py index 459db93..b1180ca 100644 --- a/bashate/bashate.py +++ b/bashate/bashate.py @@ -173,7 +173,8 @@ def check_syntax(filename, report): bash_environment['LC_ALL'] = 'C' proc = subprocess.Popen( ['bash', '-n', filename], stdout=subprocess.PIPE, - stderr=subprocess.PIPE, env=bash_environment) + stderr=subprocess.PIPE, env=bash_environment, + universal_newlines=True) outputs = proc.communicate() for line in outputs[1].split('\n'):