bundles / astropy 7.0.1 / astropy / utils / data / check_download_cache
function
astropy.utils.data:check_download_cache
source: /astropy/utils/data.py :1938
Signature
def check_download_cache ( pkgname = astropy ) Summary
Do a consistency check on the cache.
Extended Summary
Because the cache is shared by all versions of astropy in all virtualenvs run by your user, possibly concurrently, it could accumulate problems. This could lead to hard-to-debug problems or wasted space. This function detects a number of incorrect conditions, including nonexistent files that are indexed, files that are indexed but in the wrong place, and, if you request it, files whose content does not match the hash that is indexed.
This function also returns a list of non-indexed files. A few will be associated with the shelve object; their exact names depend on the backend used but will probably be based on urlmap. The presence of other files probably indicates that something has gone wrong and inaccessible files have accumulated in the cache. These can be removed with clear_download_cache, either passing the filename returned here, or with no arguments to empty the entire cache and return it to a reasonable, if empty, state.
Parameters
pkgname: str, optionalThe package name to use to locate the download cache, i.e., for
pkgname='astropy'the default cache location is~/.astropy/cache.
Raises
: `~astropy.utils.data.CacheDamaged`To indicate a problem with the cache contents; the exception contains a
.bad_filesattribute containing a set of filenames to allow the user to use clear_download_cache to remove the offending items.: OSError, RuntimeErrorTo indicate some problem with the cache structure. This may need a full clear_download_cache to resolve, or may indicate some kind of misconfiguration.
Aliases
-
astropy.utils.data.check_download_cache