Skip to content

Add check for backslashes in ImageSeries external_file paths #697

@h-mayorquin

Description

@h-mayorquin

NWB files organized on Windows can end up with backslash separators in external_file paths (e.g. ses-1_image\abc123_external_file_0.mp4). This happens because dandi organize was using os.path.join to build these paths, which produces backslashes on Windows. A fix is in progress at dandi/dandi-cli#1832.

However, NWB files with this problem already exist on the archive (e.g. Dandiset 001771), and the issue could reappear from other tools that construct external_file paths using platform-dependent path joining.

The existing check_image_series_external_file_relative already validates that paths are not absolute, using both PureWindowsPath and PurePosixPath. A similar check could flag external_file values that contain backslashes, since DANDI asset keys always use forward slashes and backslash paths will silently fail when resolved against the archive.

For context, this caused get_dandi_video_info() to return empty results for Dandiset 001771, as reported in catalystneuro/nwb-video-widgets#33.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions