Safer handling of bytestrings when making a diskimage

This commit is contained in:
Greg Neagle
2019-07-23 16:41:49 -07:00
parent 558a6494a9
commit ca7392ee8d

View File

@@ -65,10 +65,10 @@ def make_dmg(pkgpath):
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
while True:
output = proc.stdout.readline()
output = proc.stdout.readline().decode('UTF-8')
if not output and (proc.poll() != None):
break
line = output.rstrip('\n').decode('UTF-8')
line = output.rstrip('\n')
if line:
print(line)
sys.stdout.flush()