From db85ad578e4cb2141115a65229aaf6d7c520ca2d Mon Sep 17 00:00:00 2001 From: daniel-rdt Date: Fri, 3 Jul 2026 13:13:52 +0200 Subject: [PATCH 1/2] fix: change scope of --debug logging to local logger instead of globally --- utils/create_zenodo_deposition_cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/create_zenodo_deposition_cli.py b/utils/create_zenodo_deposition_cli.py index ebfc404b23..4689dea5e7 100644 --- a/utils/create_zenodo_deposition_cli.py +++ b/utils/create_zenodo_deposition_cli.py @@ -451,6 +451,9 @@ def main( """ Guide the user through creating a new Zenodo deposition or version. """ + # Set the global logging level. + logging.basicConfig(level=logging.INFO) + global ZENODO_API_URL ZENODO_API_URL = API_URLS["sandbox"] if sandbox else API_URLS["production"] @@ -462,7 +465,8 @@ def main( fg=typer.colors.YELLOW, ) if debug: - logging.basicConfig(level=logging.DEBUG) + # change local logger level to debug + logger.setLevel(logging.DEBUG) typer.secho("Debug mode enabled.", fg=typer.colors.YELLOW) typer.secho("=" * 80, fg=typer.colors.CYAN) From 121a1cac155030468acd3a789354208f432ceaa3 Mon Sep 17 00:00:00 2001 From: daniel-rdt Date: Mon, 6 Jul 2026 15:42:49 +0200 Subject: [PATCH 2/2] doc: add release note --- doc/release_notes.md | 2 ++ utils/create_zenodo_deposition_cli.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/release_notes.md b/doc/release_notes.md index 79c6bf77cc..a542d3ebe6 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -43,6 +43,8 @@ * Introduce SBOM/Grype vulnerability scanning workflow, as a follow-up to the [upstream addition](https://github.com/PyPSA/pypsa-eur/pull/2164) ([754](https://github.com/open-energy-transition/open-tyndp/pull/754)). +* Prevent `create_zenodo_deposition_cli` from leaking secrets in logs under `--debug` by scoping debug logging to the local logger instead of the root logger ([#781](https://github.com/open-energy-transition/open-tyndp/pull/781)). + ## 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 4689dea5e7..4f15adc8d2 100644 --- a/utils/create_zenodo_deposition_cli.py +++ b/utils/create_zenodo_deposition_cli.py @@ -451,7 +451,7 @@ def main( """ Guide the user through creating a new Zenodo deposition or version. """ - # Set the global logging level. + # Set the global logging level logging.basicConfig(level=logging.INFO) global ZENODO_API_URL