Skip to content

Commit

Permalink
fix: remove encoding from binary mode in requests usage
Browse files Browse the repository at this point in the history
  • Loading branch information
seppzer0 committed Apr 12, 2024
1 parent 8f999fe commit 8c1e10f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builder/tools/fileoperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def download(url: str) -> None:
else:
with requests.get(url, stream=True, headers={"referer": url}) as r:
r.raise_for_status()
with open(fn, "wb", encoding="utf-8") as f:
with open(fn, "wb") as f:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
except Exception:
msg.error("Download failed.")
except Exception as e:
msg.error(f"Download failed: {e}")
msg.done("Done!")


Expand Down

0 comments on commit 8c1e10f

Please sign in to comment.