util execute command returns formatted byte to string

This commit is contained in:
Volkan Şahin 2016-05-31 12:24:14 +03:00
parent 22f11cfc3f
commit bc82870f2b
1 changed files with 2 additions and 2 deletions

View File

@ -121,8 +121,8 @@ class Util:
process = subprocess.Popen(command, stdin=stdin, env=env, cwd=cwd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=shell) process = subprocess.Popen(command, stdin=stdin, env=env, cwd=cwd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=shell)
result_code = process.wait() result_code = process.wait()
p_out = ', '.join([str(x) for x in process.stdout.readlines()]) p_out = process.stdout.read().decode("unicode_escape")
p_err = ', '.join([str(x) for x in process.stderr.readlines()]) p_err = process.stderr.read().decode("unicode_escape")
return result_code, p_out, p_err return result_code, p_out, p_err
except Exception as e: except Exception as e: