Open output file in binary mode in download()

This fixes #553.
This commit is contained in:
Sergey Zolotarev 2014-08-08 13:08:01 +07:00
parent 7f9ac88c31
commit 4890eebd3a

View 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