diff --git a/doc/release_notes.md b/doc/release_notes.md index 00f2e3b6ac..ce304f6a3a 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -45,6 +45,8 @@ * Ensure `inflow_t` is always defined in `attach_hydro`, resolving a pylint use-before-assignment issue ([777](https://github.com/open-energy-transition/open-tyndp/pull/777)). +* Add missing regex anchors with `re.fullmatch` to `create_zenodo_deposition_cli` utils script ([778](https://github.com/open-energy-transition/open-tyndp/pull/778)). + ## Upcoming PyPSA-Eur Release * Security: SBOM security scan included in CI. diff --git a/utils/create_zenodo_deposition_cli.py b/utils/create_zenodo_deposition_cli.py index ebfc404b23..526eec211f 100644 --- a/utils/create_zenodo_deposition_cli.py +++ b/utils/create_zenodo_deposition_cli.py @@ -428,8 +428,8 @@ def extract_zenodo_deposition_url(record_url: str) -> tuple[str, str]: The Zenodo deposition API URL, or None if extraction fails. """ # Match both sandbox and production, with or without /files/... - m = re.match( - r"https://(?:sandbox\.)?zenodo\.org/records/(\d+)(/files/.*)?", record_url + m = re.fullmatch( + r"https://(?:sandbox\.)?zenodo\.org/records/(\d+)(/files(/.*)?)?", record_url ) if not m: raise ValueError(f"Invalid Zenodo record URL format: {record_url}. ")