1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

forgejo/inject-pr-samples: properly flush and close injected sample before hashing

This commit is contained in:
Timo Rothenpieler
2026-08-31 19:17:47 +02:00
parent 486f03997c
commit 4efbbd1543

View File

@@ -109,6 +109,7 @@ def download(url, dst):
with urllib.request.urlopen(url) as r:
while chunk := r.read(1 << 16):
tmp.write(chunk)
tmp.close()
if dst.exists() and digest(dst) != digest(tmp_path):
raise ValueError(f"already exists with different content: {dst}")
tmp_path.rename(dst)