From 4890eebd3ae5b4a20dc153eab032ad2af8b80817 Mon Sep 17 00:00:00 2001 From: Sergey Zolotarev Date: Fri, 8 Aug 2014 13:08:01 +0700 Subject: [PATCH] Open output file in binary mode in download() This fixes #553. --- script/lib/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/lib/util.py b/script/lib/util.py index c78ca213e1..17595742ed 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