Skip to content

Commit 8c1e10f

Browse files
committed
fix: remove encoding from binary mode in requests usage
1 parent 8f999fe commit 8c1e10f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builder/tools/fileoperations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ def download(url: str) -> None:
4949
else:
5050
with requests.get(url, stream=True, headers={"referer": url}) as r:
5151
r.raise_for_status()
52-
with open(fn, "wb", encoding="utf-8") as f:
52+
with open(fn, "wb") as f:
5353
for chunk in r.iter_content(chunk_size=8192):
5454
f.write(chunk)
55-
except Exception:
56-
msg.error("Download failed.")
55+
except Exception as e:
56+
msg.error(f"Download failed: {e}")
5757
msg.done("Done!")
5858

5959

0 commit comments

Comments
 (0)