From 880a0bc5c5c210aab792027f5f9c517ead4d70cf Mon Sep 17 00:00:00 2001 From: Mark Bader Date: Mon, 13 May 2024 11:56:32 +0200 Subject: [PATCH] Replace backslashes in windows upload (#1067) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update generate_unique_identifier lambda to use a posix path. * Update Changelog.md * add missing requests dependency for windows * Generate poetry lock file. * Revert changes of pyproject toml. --------- Co-authored-by: Michael Büßemeyer --- webknossos/Changelog.md | 1 + webknossos/webknossos/client/_upload_dataset.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/webknossos/Changelog.md b/webknossos/Changelog.md index 929a5c4e9..08909b870 100644 --- a/webknossos/Changelog.md +++ b/webknossos/Changelog.md @@ -19,6 +19,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section ### Changed ### Fixed +- Performing `webknossos upload` on a windows machine leaded to loss of directory structure due to backslashes in the relative paths. This was fixed by [1067](https://github.com/scalableminds/webknossos-libs/pull/1067) ## [0.14.21](https://github.com/scalableminds/webknossos-libs/releases/tag/v0.14.21) - 2024-05-07 diff --git a/webknossos/webknossos/client/_upload_dataset.py b/webknossos/webknossos/client/_upload_dataset.py index 670b6c7de..e03ffe17a 100644 --- a/webknossos/webknossos/client/_upload_dataset.py +++ b/webknossos/webknossos/client/_upload_dataset.py @@ -152,7 +152,7 @@ def upload_dataset( }, chunk_size=100 * 1024 * 1024, # 100 MiB generate_unique_identifier=lambda _, - relative_path: f"{upload_id}/{relative_path}", + relative_path: f"{upload_id}/{relative_path.as_posix()}", test_chunks=False, permanent_errors=[400, 403, 404, 409, 415, 500, 501], client=httpx.Client(timeout=None),