Recursive get (sync) broken for empty folders.

Description

1 2 3 4 5 6 7 8 syn get -r syn11678367 making dir ./Cluster energy features with postural tremor Downloading [####################]100.00% 1.3MB/1.3MB (734.0kB/s) Postural_tremor.html Done... making dir ./Cluster energy features with resting tremor Downloading [####################]100.00% 1.7MB/1.7MB (1.8MB/s) Resting_tremor.html Done... making dir ./Clustering of most predictive features The synapse id syn12087406 is not a container (Project/Folder), attempting to get the entity anyways ValueError: The provided id: syn12087406 is was neither a container nor a File

The logic:

1 2 3 4 5 6 7 8 if zero_results: #a http error would be raised if the synapse Id was not valid (404) or no permission (403) so at this point the entity should be get-able stderr.write("The synapse id %s is not a container (Project/Folder), attempting to get the entity anyways" % id) ent = syn.get(id, downloadLocation=path, ifcollision=ifcollision, followLink=followLink) if isinstance(ent, File): allFiles.append(ent) else: raise ValueError("The provided id: %s is was neither a container nor a File" % id)

is wrong as zero results will be returned for an empty folder and getting the folder will not compare correctly to a File.

Also why aren't we using synapseutils.walk here instead of replicating the code.

Environment

None

Status

Assignee

Kimyen Truong

Reporter

Larsson Omberg

Labels

None

Validator

Kenneth Daily

Release Version History

None

Fix versions

Priority

Major