cacheDir is getting set to the wrong information which causes the cat command to fail in the command line client. Repro:
e = syn.get('syn8232164')
In : e.cacheDir
Out: u'mPower clinical data and timestamps 5.1.17.csv'
The failure code for command line hence becomes:
syn --debug cat syn8232164
Traceback (most recent call last):
File "/usr/local/bin/synapse", line 11, in <module>
load_entry_point('synapseclient', 'console_scripts', 'synapse')()
File "/Users/lom/Dropbox/Sage/synapsePythonClient/synapseclient/__main__.py", line 806, in main
File "/Users/lom/Dropbox/Sage/synapsePythonClient/synapseclient/__main__.py", line 778, in perform_main
File "/Users/lom/Dropbox/Sage/synapsePythonClient/synapseclient/__main__.py", line 257, in cat
with open(os.path.join(entity['cacheDir'], filepath)) as inputfile:
IOError: [Errno 20] Not a directory: u'mPower clinical data and timestamps 5.1.17.csv/mPower clinical data and timestamps 5.1.17.csv'
There appears to be two issues at hand here:
1) The recent caching/getWithEntityBundle code changed what we store in cacheDir - it should be the basepath to where the file is located
2) The cat() function in _main_ is using an older way of accessing the file location. It uses a for loop over ALL files that are associated with the entity which means it does a merge of the cacheDir and the entity.files variables. We are no longer supporting multiple files with an entity and should just use entity.filepath.