Skip to content

Commit

Permalink
First input of urllib.request.urlopen could only be of type 'str' or …
Browse files Browse the repository at this point in the history
…a Request object. (#89)

* First input of urllib.request.urlopen could only be of type 'str' or a Request object.
Right now, `url` in AsyncExternalDownload is of type dictionary that leads to following error:

AttributeError: 'dict' object has no attribute 'timeout'
See: https://docs.python.org/3/library/urllib.request.html#module-urllib.request

* minor fixes on `async def finish_download`
  • Loading branch information
khsrali authored Feb 29, 2024
1 parent 6c1d2bf commit afdfdb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions firecrest/AsyncExternalStorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ async def object_storage_link(self) -> str:
:calls: GET `/tasks/{taskid}`
"""
if self._client._api_version > Version("1.13.0"):
return await self.object_storage_data["url"]
return (await self.object_storage_data)["url"]
else:
return await self.object_storage_data

Expand All @@ -240,7 +240,7 @@ async def finish_download(
:param target_path: the local path to save the file
"""
url = await self.object_storage_data
url = await self.object_storage_link
logger.info(f"Downloading the file from {url} and saving to {target_path}")
# LOCAL FIX FOR MAC
# url = url.replace("192.168.220.19", "localhost")
Expand Down

0 comments on commit afdfdb6

Please sign in to comment.