summaryrefslogtreecommitdiffstats
path: root/tools/usb_gadget
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2014-12-15 10:50:47 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-15 18:51:08 +0000
commit4d1bd58166ba82a9751ad8c66ccce6764922a14a (patch)
treedfb40d2db97c067300acfca908781c2530a05d98 /tools/usb_gadget
parent15e1e059037ac923a56537223d741670a826be04 (diff)
downloadchromium_src-4d1bd58166ba82a9751ad8c66ccce6764922a14a.zip
chromium_src-4d1bd58166ba82a9751ad8c66ccce6764922a14a.tar.gz
chromium_src-4d1bd58166ba82a9751ad8c66ccce6764922a14a.tar.bz2
Write the packaged USB gadget app in binary mode.
On Windows binary files will be corrupted if they are not written in binary mode. BUG= Review URL: https://codereview.chromium.org/799073005 Cr-Commit-Position: refs/heads/master@{#308377}
Diffstat (limited to 'tools/usb_gadget')
-rwxr-xr-xtools/usb_gadget/package.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/usb_gadget/package.py b/tools/usb_gadget/package.py
index 069bb14..1c50033 100755
--- a/tools/usb_gadget/package.py
+++ b/tools/usb_gadget/package.py
@@ -82,10 +82,10 @@ def main():
content, md5 = MakeZip(directory=args.dir, files=args.files)
if args.zip_file:
- with open(args.zip_file, 'w') as zip_file:
+ with open(args.zip_file, 'wb') as zip_file:
zip_file.write(content)
if args.hash_file:
- with open(args.hash_file, 'w') as hash_file:
+ with open(args.hash_file, 'wb') as hash_file:
hash_file.write(md5)
if args.upload:
UploadZip(content, md5, args.upload)