Skip to content

Commit fabcf03

Browse files
committed
fix: use of closed file in ZstdCompatibleTarFile
1 parent f2dc3d2 commit fabcf03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DIRAC/WorkloadManagementSystem/Client/SandboxStoreClient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def ZstdCompatibleTarFile(tarFileName: os.PathLike, *, mode: Literal["r"] = "r")
3434
# Read magic bytes to determine compression format
3535
if magic.startswith(b"\x28\xb5\x2f\xfd"): # zstd magic number
3636
dctx = zstandard.ZstdDecompressor()
37-
with dctx.stream_reader(f) as decompressor:
37+
with open(tarFileName, "rb") as f, dctx.stream_reader(f) as decompressor:
3838
with tarfile.open(fileobj=decompressor, mode=f"{mode}|") as tf:
3939
yield tf
4040
else:

0 commit comments

Comments
 (0)