We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6624e1c commit 2bb5092Copy full SHA for 2bb5092
1 file changed
core/cluster.py
@@ -4,6 +4,7 @@
4
import datetime
5
import hmac
6
import json
7
+import os
8
from pathlib import Path
9
import sys
10
import tempfile
@@ -545,6 +546,7 @@ async def _download_file(
545
546
hash = utils.get_hash_obj(file.hash)
547
with tempfile.NamedTemporaryFile(
548
dir=self._cache_dir,
549
+ delete=False
550
) as tmp_file:
551
try:
552
async with session.get(
@@ -568,6 +570,9 @@ async def _download_file(
568
570
pbar.update(-size)
569
571
self.update_failed()
572
continue
573
+ finally:
574
+ tmp_file.close()
575
+ os.remove(tmp_file.name)
576
return None
577
if last_error is not None:
578
raise last_error
0 commit comments