Skip to content

Commit d1672f9

Browse files
authored
fix: add missing regular expression anchor with re.fullmatch (#2225)
* fix: add missing regular expression anchors with re.fullmatch * doc: add release note
1 parent ebd0cbe commit d1672f9

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

doc/release_notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949

5050
- doc: Disable root TOC entries in order to declutter the table of contents for the rules overview ([2216](https://github.com/PyPSA/pypsa-eur/pull/2216)).
5151

52+
* Add missing regex anchor with `re.fullmatch` to `create_zenodo_deposition_cli` utils script ([#2225](https://github.com/PyPSA/pypsa-eur/pull/2225)).
53+
5254
## PyPSA-Eur v2026.02.0 (18th February 2026)
5355

5456
**Features**

utils/create_zenodo_deposition_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ def extract_zenodo_deposition_url(record_url: str) -> tuple[str, str]:
428428
The Zenodo deposition API URL, or None if extraction fails.
429429
"""
430430
# Match both sandbox and production, with or without /files/...
431-
m = re.match(
432-
r"https://(?:sandbox\.)?zenodo\.org/records/(\d+)(/files/.*)?", record_url
431+
m = re.fullmatch(
432+
r"https://(?:sandbox\.)?zenodo\.org/records/(\d+)(/files(/.*)?)?", record_url
433433
)
434434
if not m:
435435
raise ValueError(f"Invalid Zenodo record URL format: {record_url}. ")

0 commit comments

Comments
 (0)