From f6c485101d16d79269dbf5e67cfe0b4b3a50509c Mon Sep 17 00:00:00 2001 From: joshuaswanson Date: Thu, 2 Apr 2026 17:19:30 +0200 Subject: [PATCH] Fix intersphinx leaking basic auth credentials in error and info messages --- sphinx/ext/intersphinx/_load.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/ext/intersphinx/_load.py b/sphinx/ext/intersphinx/_load.py index ab6a373fea0..4b954900159 100644 --- a/sphinx/ext/intersphinx/_load.py +++ b/sphinx/ext/intersphinx/_load.py @@ -401,7 +401,7 @@ def _fetch_inventory_url( except Exception as err: err.args = ( 'intersphinx inventory %r not fetchable due to %s: %s', - inv_location, + _get_safe_url(inv_location), err.__class__, str(err), ) @@ -409,7 +409,7 @@ def _fetch_inventory_url( if inv_location != new_inv_location: msg = __('intersphinx inventory has moved: %s -> %s') - LOGGER.info(msg, inv_location, new_inv_location) + LOGGER.info(msg, _get_safe_url(inv_location), _get_safe_url(new_inv_location)) if target_uri in { inv_location,