From 0aabf1626f47800734d54bf7f5bd098634b5e5f1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 14 Jun 2024 10:20:29 -0400 Subject: [PATCH] BF: fix download_directory for side-effect of normalizing paths while getting listing --- dandi/dandiapi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dandi/dandiapi.py b/dandi/dandiapi.py index f2a7f4750..5ea504de7 100644 --- a/dandi/dandiapi.py +++ b/dandi/dandiapi.py @@ -1258,6 +1258,9 @@ def download_directory( """ if assets_dirpath and not assets_dirpath.endswith("/"): assets_dirpath += "/" + # need to normalize explicitly since we do use it below also + # to deduce portion of the path to strip off. + assets_dirpath = self._normalize_path(assets_dirpath) assets = list(self.get_assets_with_path_prefix(assets_dirpath)) for a in assets: filepath = Path(dirpath, a.path[len(assets_dirpath) :])