logger.info("Downloading {}...".format(url))
with closing(self._session().get(url, stream=True)) as res:
if res.status_code != requests.codes.ok:
raise FetchError("Failed to download {} ({} error)".format(url, res.status_code))
with temporary_file() as archive_fp:
// NB: Archives might be very large so we play it safe and buffer them to disk instead of
// memory before unpacking.
for chunk in res.iter_content(chunk_size=self.get_options().buffer_size):
After Change
logger.info(f"Downloading {url}...")
with closing(self._session().get(url, stream=True)) as res:
if res.status_code != requests.codes.ok:
raise FetchError(f"Failed to download {url} ({res.status_code} error)")
with temporary_file() as archive_fp:
// NB: Archives might be very large so we play it safe and buffer them to disk instead of
// memory before unpacking.
for chunk in res.iter_content(chunk_size=self.get_options().buffer_size):