Skip to content

Commit b64ac22

Browse files
authored
need to check if file and split out the suffix only logic
my mistake. didn't realize that some file formats were missing standard suffixes.
1 parent f77a411 commit b64ac22

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

neo/io/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def list_candidate_ios(file_or_folder, ignore_patterns=['*.ini', 'README.txt', '
429429
"""
430430
file_or_folder = pathlib.Path(file_or_folder)
431431

432-
if file_or_folder.suffix:
432+
if file_or_folder.is_file():
433433
suffix = file_or_folder.suffix[1:].lower()
434434
if suffix not in io_by_extension:
435435
raise ValueError(f'{suffix} is not a supported format of any IO.')
@@ -453,6 +453,12 @@ def list_candidate_ios(file_or_folder, ignore_patterns=['*.ini', 'README.txt', '
453453
elif file_or_folder.parent.exists():
454454
filenames = file_or_folder.parent.glob(file_or_folder.name + '*')
455455

456+
elif file_or_folder.suffix:
457+
suffix = file_or_folder.suffix[1:].lower()
458+
if suffix not in io_by_extension:
459+
raise ValueError(f'{suffix} is not a supported format of any IO.')
460+
return io_by_extension[suffix]
461+
456462
else:
457463
raise ValueError(f'{file_or_folder} does not contain data files of a supported format')
458464

0 commit comments

Comments
 (0)