explicit string encoding when writing to file in python3

This commit is contained in:
Hilton Bristow
2013-12-24 16:39:29 +10:00
parent 7cad2c6788
commit 483061e802
3 changed files with 7 additions and 7 deletions

View File

@@ -21,7 +21,7 @@ def substitute(build, output_dir):
# populate template
populated = template.render(build=build, time=time)
with open(os.path.join(output_dir, 'buildInformation.m'), 'wb') as f:
f.write(populated)
f.write(populated.encode('utf-8'))
if __name__ == "__main__":
"""