only strip period if extensions are strings
@@ -903,11 +903,11 @@ class BIDSLayout(object):
entities = self.get_entities()
- # For consistency with past versions where "extensions" was a
- # hard-coded argument, allow leading periods
+ # Strip leading periods if extensions were passed
if 'extension' in filters:
exts = listify(filters['extension'])
- filters['extension'] = [x.lstrip('.') for x in exts]
+ filters['extension'] = [x.lstrip('.') if isinstance(x, str) else x
+ for x in exts]
if drop_invalid_filters:
invalid_filters = set(filters.keys()) - set(entities.keys())
