-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
I'm tracking down a problem using a cached coordinates/sites.json on a read-only filesystem.
An issue I am finding is this:
in astropy/utils/data.py,
get_pkg_data_fileobj
ends up calling
get_readable_fileobj
with a URL, which calls
download_file()
Now, even if the file is already in the cache, on data.py:1005 it ends up calling
with urllib.request.urlopen(conf.dataurl, timeout=timeout) as remote:
_dataurls_to_alias[conf.dataurl] = [conf.dataurl, remote.geturl()]
to find out if the URL is an alias.
Now, okay, this only gets called once per session, but really? Please can you avoid doing this somehow? Pre-fill known aliases for data.astropy.org, maybe? ie, initialize:
_dataurls_to_alias = {'http://data.astropy.org/': ['http://data.astropy.org/', 'https://astropy.stsci.edu/data/']}