From aa7c701106828e85d0eeec3736e2778171904504 Mon Sep 17 00:00:00 2001 From: Wesley van Lee Date: Fri, 1 Nov 2024 16:19:25 +0100 Subject: [PATCH] Ensure export URI ends with a slash or filenaming will cause issues in s3 --- scrapy_webarchive/extensions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapy_webarchive/extensions.py b/scrapy_webarchive/extensions.py index 255a1d8..fcb9014 100644 --- a/scrapy_webarchive/extensions.py +++ b/scrapy_webarchive/extensions.py @@ -91,7 +91,8 @@ def _retrieve_store_uri_and_wacz_fname(self) -> Tuple[str, Union[str, None]]: if os.path.isdir(export_uri): return export_uri, None else: - return os.path.split(export_uri) + export_uri, wacz_fname = os.path.split(export_uri) + return f"{export_uri}/", wacz_fname def _get_store(self, store_uri: str) -> FilesStoreProtocol: store_cls = self.STORE_SCHEMES[get_scheme_from_uri(store_uri)]