Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 1ae2d4d

Browse files
committed
robust download
1 parent 8cb6558 commit 1ae2d4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cads_api_client/processing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,8 @@ def download(
698698
parts = urllib.parse.urlparse(url)
699699
target = parts.path.strip("/").split("/")[-1]
700700

701-
with open(target, "wb"): # Clear existing file
702-
pass
701+
if os.path.exists(target):
702+
os.remove(target)
703703

704704
robust_download = multiurl.robust(self._download, **self.retry_options)
705705
robust_download(url, target)

0 commit comments

Comments
 (0)