mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
ccbba8656b
commit
3e08d3de8a
1 changed files with 2 additions and 2 deletions
4
setup.py
4
setup.py
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue