From 1ea8dbab0dc02062fbf2094f185693b9294c9642 Mon Sep 17 00:00:00 2001 From: Peter Dragun Date: Fri, 6 Mar 2026 15:44:20 +0100 Subject: [PATCH] fix(idf_tools.py): Print correct path to Install Certificates.command on macOS Related to: https://github.com/espressif/esp-idf/issues/17787 --- tools/idf_tools.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/idf_tools.py b/tools/idf_tools.py index f7fad23953..2b0089d3ee 100755 --- a/tools/idf_tools.py +++ b/tools/idf_tools.py @@ -185,8 +185,15 @@ def print_hints_on_download_error(err: str) -> None: info('The following commands may help resolve this issue:') if sys.platform == 'darwin': - info(' ./Install\\ Certificates.command') - info(f' {sys.executable} -m pip install --upgrade pip-system-certs certifi') + # Python.org macOS installer puts Install Certificates.command in /Applications/Python X.Y/ + app_certs = ( + f'/Applications/Python {sys.version_info.major}.{sys.version_info.minor}/Install Certificates.command' + ) + if os.path.isfile(app_certs): + info(f'\tRun: open "{app_certs}" (or double-click it in Finder)') + else: + info('\tGo to Python installation location and execute: ./Install\\ Certificates.command') + info(f'\t{sys.executable} -m pip install --upgrade pip-system-certs certifi') # Certificate issue on Windows can be hidden under different errors which might be even translated, # e.g. "[WinError -2146881269] ASN1 valor de tag inválido encontrado"