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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user