fixed environment passing to subprocess

This commit is contained in:
Ondrej Samohel 2019-12-03 19:02:16 +01:00
parent 7ff6f468fa
commit 8ed99e5759
No known key found for this signature in database
GPG key ID: 8A29C663C672C2B7

View file

@ -19,12 +19,15 @@ log = logging.getLogger(__name__)
def _subprocess(args):
"""Convenience method for getting output errors for subprocess."""
# make sure environment contains only strings
env = {k: str(v) for k, v in os.environ.items()}
proc = subprocess.Popen(
args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE,
env=os.environ
env=env
)
output = proc.communicate()[0]