Setup::DownloadWindowsDlls is downloading and writing the file as
a text not a binary file.

When creating the file handle to write the binary after being download from salt's
dependency repo, the file handle was being created with just the 'write' attribute,
however it also needs the 'binary' attribute.

Change-Id: I2f67d27ee847cd7808a78cd5ec0b2151d6a0c0e7
This commit is contained in:
Dennis Harper 2015-09-28 11:51:53 -05:00 committed by rallytime
parent ccbba8656b
commit 3e08d3de8a

View file

@ -396,7 +396,7 @@ class DownloadWindowsDlls(Command):
from contextlib import closing
with closing(requests.get(furl, stream=True)) as req:
if req.status_code == 200:
with open(fdest, 'w') as wfh:
with open(fdest, 'wb') as wfh:
for chunk in req.iter_content(chunk_size=4096):
if chunk: # filter out keep-alive new chunks
wfh.write(chunk)
@ -411,7 +411,7 @@ class DownloadWindowsDlls(Command):
req = urlopen(furl)
if req.getcode() == 200:
with open(fdest, 'w') as wfh:
with open(fdest, 'wb') as wfh:
while True:
for chunk in req.read(4096):
if not chunk: