Skip to content

Replace astropy.utils.data.download_file with httpx #332

@hugobuddel

Description

@hugobuddel

download_file() from astropy.utils.data can lead to various Exceptions with the univie webserver, e.g.

urllib.error.ContentTooShortError: <urlopen error File was supposed to be 10713600 bytes but we only got 10713359 bytes. Download failed.

This bothers end users, and makes our tests fail unreliably.

Replacing download_file() with equivalent functionality from httpx with proper retry functions seems to 'fix' this problem. So we should use that everywhere.

Places where we use download_file():

So this issue transcends just ScopeSim.

Metadata

Metadata

Assignees

Labels

refactorImplementation improvement

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions