Skip to content

Custom cache location does not work when the directory does not exist #18436

@danielhill676

Description

@danielhill676

Description

Hello, I am trying to change the cache path as it keep exceeded disk quota when downloading data. I have set the environmental variable XDG_CACHE_HOME, but when checked with astropy.config.paths.get_cache_dir() it remains the default. How do I fix this?

Expected behavior

from https://docs.astropy.org/en/stable/environment_variables.html

XDG_CACHE_HOME
These environment variables control where data files are cached. Astropy will cache files in $XDG_CACHE_HOME/astropy. If not set, or if $XDG_CACHE_HOME/astropy does not exist, astropy will default to $HOME/.astropy/cache. See Downloadable Data Management (astropy.utils.data) for how to programmatically set or get the location of the corresponding directory at runtime.

How to Reproduce

Versions

import astropy
astropy.__version__
# Paste the result here

'5.3.4'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions