text = pipe.read()
sts = pipe.close() or 0
- if text[-1:] == '\n':
+ while text[-1:] in ['\n', '\r']:
text = text[:-1]
return sts, text
output = os.path.join(install_dir, output_file)
self.mkpath(install_dir)
- open(output, 'w').write(template)
+ open(output, 'wb').write(template)
self.local_inputs.append(filename)
self.local_outputs.append(output)
return output