]> khamidou — GitHub mirrors - electron.git/commitdiff
Open output file in binary mode in download()
authorSergey Zolotarev <sryze@users.noreply.github.com>
Fri, 8 Aug 2014 06:08:01 +0000 (13:08 +0700)
committerSergey Zolotarev <sryze@users.noreply.github.com>
Fri, 8 Aug 2014 06:08:01 +0000 (13:08 +0700)
This fixes #553.

script/lib/util.py

index c78ca213e199462baa7e3673c84301c186acbca8..17595742edb5856f2af0cf694b13442836cb0924 100644 (file)
@@ -31,7 +31,7 @@ def scoped_cwd(path):
 
 def download(text, url, path):
   safe_mkdir(os.path.dirname(path))
-  with open(path, 'w') as local_file:
+  with open(path, 'wb') as local_file:
     web_file = urllib2.urlopen(url)
     file_size = int(web_file.info().getheaders("Content-Length")[0])
     downloaded_size = 0