Open hughdbrown opened 1 year ago
https://github.com/biobootloader/wolverine/blob/2f5a026ff96971a4c00491ad628fae6b7e1c503c/wolverine.py#L36-L40
if you pass encoding='utf-8' to subprocess.run, your strings are automatically decoded:
encoding='utf-8'
subprocess.run
>>> s = subprocess.run("/bin/echo 'hello'".split(" "), stdout=subprocess.PIPE) >>> s.stdout b"'hello'\n" >>> s = subprocess.run("/bin/echo 'hello'".split(" "), stdout=subprocess.PIPE, encoding="utf-8") >>> s.stdout "'hello'\n"
So:
try: result = subprocess.check_output(subprocess_args, stderr=subprocess.STDOUT, encoding="utf-8") except subprocess.CalledProcessError as e: return e.output, e.returncode return result, 0
https://github.com/biobootloader/wolverine/blob/2f5a026ff96971a4c00491ad628fae6b7e1c503c/wolverine.py#L36-L40
if you pass
encoding='utf-8'
tosubprocess.run
, your strings are automatically decoded:So: