py3 Popen text mode fix

This commit is contained in:
Tomas Kopecek 2021-08-06 12:31:04 +02:00
parent 1427b3e850
commit 0cfb2c0280

View file

@ -548,11 +548,11 @@ def run(cmd, chdir=None, fatal=False, log=True):
logger = logging.getLogger('koji.vm')
logger.info('$ %s', ' '.join(cmd))
proc = subprocess.Popen(cmd, stdout=logfd, stderr=subprocess.STDOUT,
close_fds=True)
close_fds=True, text=True)
ret = proc.wait()
else:
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
close_fds=True)
close_fds=True, text=True)
output, dummy = proc.communicate()
ret = proc.returncode
if olddir: