From 4efbbd15438413bc2224f15edc4cbb080cd25896 Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Mon, 31 Aug 2026 19:17:47 +0200 Subject: [PATCH] forgejo/inject-pr-samples: properly flush and close injected sample before hashing --- .forgejo/inject-pr-samples.py | 1 + 1 file changed, 1 insertion(+) diff --git a/.forgejo/inject-pr-samples.py b/.forgejo/inject-pr-samples.py index 3f50067751..0c328279e0 100755 --- a/.forgejo/inject-pr-samples.py +++ b/.forgejo/inject-pr-samples.py @@ -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)