Public interface to customize CACHE_ROOT_DIR




Phil Snyder
February 10, 2021, 10:30 PM

The new kwarg works for me in Python 3.9.0.

Jordan Kiang
February 10, 2021, 7:17 PM

and while setting the cache_root_dir on the cache object works (and will continue to work) as Kim alluded to it involves setting a property in a “core” module (synapseclient.core.cache) which is not ideal as it’s intended to be semi-private. It’ll continue to be accessible at that property so we don’t break code that is relying on this, but has added an optional cache_root_dir kwarg to the Synapse constructor to allow setting this on a per instance basis and via a documented argument.

Can you validate that this works for you since you have both commented on this issue.

If you would like to install the release candidate that this is a part of it can be installed e.g.

pip3 install --upgrade --index-url --extra-index-url "synapseclient>=2.3.0"

Kimyen Truong
April 22, 2019, 7:08 PM

, do not depend on its yet. In version 2.0, I will document that the client has a cache, and expose some functions to work with the cache. This is definitely be one of them. But the way to call it may be different. I’m not sure yet. I will keep this ticket so that you can test it out though.

Phil Snyder
April 22, 2019, 6:08 PM

I was able to change the cache directory by setting syn.cache.cache_root_dir (`syn` being an already initialized Synapse object).

Kimyen Truong
January 7, 2019, 6:29 PM

With 's comment, it seems like the cache directory is already “customizable” if users know when to use it (before initializing the Synapse object). I would like to learn more about if there is a need to change the cache directory after the Synapse object is initialized? And if it makes sense to do so.
If not, we just need to document what James said.



Chia-Hui Lin


Kimyen Truong


Kenneth Daily

Development Area


Release Version History


Slack Channel



Fix versions