1
0
Fork 0
forked from len0rd/rockbox

When writing data from repository open file as binary.

Windows requires files to be explicitly opened as binaries, otherwise it will
perform line ending translations. We really don't want the OS to mess with
that.

Change-Id: Id56de354b7ad0e5b056540755f7108456f3263ed
This commit is contained in:
Dominik Riebeling 2012-02-06 00:14:25 +01:00
parent 13e640c2d6
commit 64f71e66b2

View file

@ -115,7 +115,7 @@ def get_object(repo, blob, destfile):
return False return False
if not os.path.exists(os.path.dirname(destfile)): if not os.path.exists(os.path.dirname(destfile)):
os.makedirs(os.path.dirname(destfile)) os.makedirs(os.path.dirname(destfile))
f = open(destfile, 'w') f = open(destfile, 'wb')
for line in cmdout[0]: for line in cmdout[0]:
f.write(line) f.write(line)
f.close() f.close()