From: Sergey Zolotarev Date: Fri, 8 Aug 2014 06:08:01 +0000 (+0700) Subject: Open output file in binary mode in download() X-Git-Tag: v0.15.5~13^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=4890eebd3ae5b4a20dc153eab032ad2af8b80817;p=electron.git Open output file in binary mode in download() This fixes #553. --- diff --git a/script/lib/util.py b/script/lib/util.py index c78ca213..17595742 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -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