Using a cache across client seems broken when using a custom cache directory.
Repro:
In Python:
!mkdir ~/asdfasdfasdf
syn.cache.cache_root_dir='~/asdfasdfasdf'
f = syn.get('syn4994640')
Then in R:
synapseCacheDir('~/asdfasdfasdf')
ent <- synGet('syn4994640')
Or switch the order between R and Python. Either way the file gets downloaded the second time from R/Python
See
it appears the Python client is incorrectly resolving path shortcuts such as '~'.
After setting syn.cache.cache_root_dir='~/asdfasdfasdf', f.path was still pointing to the '/Users/zdong/.synapseCache/' folder.
I then deleted the cache directories and used an absolute path for the cache:
syn.cache.cache_root_dir='/Users/zdong/asdfasdfasdf'
f.path now gives the correct cache location and the R client no longer redownloaded the file.
That is odd: the code specifically includes information to handle this:
also, the default cachdir includes the ~:
that only happens in the constructor. If the user manually assigns the variable it does not get expanded. I've overridden the _setattr_() to expand cache_root_dir