diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f85d72b51..15dd45bfe 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,6 +13,7 @@ Breaking changes Bug fixes ^^^^^^^^^ * Fixed pickling issue with ``xclim.sdba.Grouper`` and other classes for usage with `dask>=2024.11`. (:issue:`1992`, :pull:`1993`). +* Fixed an issue with ``nimbus`` that was causing URL path components to be improperly joined. (:pull:`1997`). Internal changes ^^^^^^^^^^^^^^^^ diff --git a/xclim/testing/utils.py b/xclim/testing/utils.py index dad66b212..25a626bd7 100644 --- a/xclim/testing/utils.py +++ b/xclim/testing/utils.py @@ -435,7 +435,12 @@ def load_registry( dict Dictionary of filenames and hashes. """ - remote_registry = audit_url(f"{repo}/{branch}/data/registry.txt") + remote_registry = audit_url( + urljoin( + urljoin(repo, branch if branch.endswith("/") else f"{branch}/"), + "data/registry.txt", + ) + ) if branch != default_testdata_version: custom_registry_folder = Path( @@ -511,8 +516,9 @@ def nimbus( # noqa: PR01 "The `pooch` package is required to fetch the xclim testing data. " "You can install it with `pip install pooch` or `pip install xclim[dev]`." ) - - remote = audit_url(f"{repo}/{branch}/data") + remote = audit_url( + urljoin(urljoin(repo, branch if branch.endswith("/") else f"{branch}/"), "data") + ) return pooch.create( path=cache_dir, base_url=remote,