From eafd1823b3bbee7167e9d78289817a8cd76b8bef Mon Sep 17 00:00:00 2001 From: John Wilkie <124276291+JBWilkie@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:42:09 +0100 Subject: [PATCH] Ignore the properties metadata file when reading annotations on Windows filesystems (#854) --- darwin/utils/utils.py | 2 +- tests/darwin/exporter/formats/export_darwin_test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/darwin/utils/utils.py b/darwin/utils/utils.py index e594964c2..4d3dad18e 100644 --- a/darwin/utils/utils.py +++ b/darwin/utils/utils.py @@ -1471,7 +1471,7 @@ def get_annotation_files_from_dir(path: Path) -> Iterator[str]: return ( str(filepath) for filepath in sorted(path.glob("**/*.json")) - if "/.v7/" not in str(filepath) + if "/.v7/" not in str(filepath) and "\\.v7\\" not in str(filepath) ) diff --git a/tests/darwin/exporter/formats/export_darwin_test.py b/tests/darwin/exporter/formats/export_darwin_test.py index e53fe5b0c..487145269 100644 --- a/tests/darwin/exporter/formats/export_darwin_test.py +++ b/tests/darwin/exporter/formats/export_darwin_test.py @@ -141,3 +141,4 @@ def test_properties_metadata_is_ignored_when_reading_annotations_directory(): annotation_filepaths = list(get_annotation_files_from_dir(Path(tmpdirname))) for annotation_filepath in annotation_filepaths: assert "./v7/" not in annotation_filepath + assert "\\.v7\\" not in annotation_filepath