Skip to content

Commit 0d4caba

Browse files
Merge pull request #660 from Open-EO/avoid-empty-file
Avoid making empty fail if _get_response failed.
2 parents 803fa2b + 48e31db commit 0d4caba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openeo/rest/job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,8 @@ def download(
376376
target = target / self.name
377377
ensure_dir(target.parent)
378378
logger.info("Downloading Job result asset {n!r} from {h!s} to {t!s}".format(n=self.name, h=self.href, t=target))
379+
response = self._get_response(stream=True)
379380
with target.open("wb") as f:
380-
response = self._get_response(stream=True)
381381
for block in response.iter_content(chunk_size=chunk_size):
382382
f.write(block)
383383
return target

0 commit comments

Comments
 (0)