We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab83427 commit 820743cCopy full SHA for 820743c
1 file changed
update.py
@@ -27,6 +27,9 @@ def download_file(session, url, dest):
27
with session.get(url, stream=True, timeout=10) as r:
28
r.raise_for_status()
29
with open(dest, 'wb') as f:
30
+ if 'Content-Length' in r.headers:
31
+ length = int(r.headers['Content-Length'])
32
+ f.truncate(length)
33
shutil.copyfileobj(r.raw, f)
34
35
# Fix for "read-only" files on Windows
0 commit comments