From 32d46df18ddbc6e308b1598e7e76b0d62f1a25b7 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 15 Aug 2026 00:01:20 +0200 Subject: [PATCH] lib.App: Log reason for skipped completion The shell completion setup in __run() catches every exception and silently ignores it. If argcomplete is missing or its initialization fails, the completion is simply not available and there is no trace of why, even when logging is turned up to debug level. Log the reason at debug level: one message when the argcomplete import fails and one with the exception for any other failure. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2 Signed-off-by: Jan Lindemann --- src/python/jw/pkg/lib/App.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/python/jw/pkg/lib/App.py b/src/python/jw/pkg/lib/App.py index 01e3bb3c..25faf496 100644 --- a/src/python/jw/pkg/lib/App.py +++ b/src/python/jw/pkg/lib/App.py @@ -284,8 +284,10 @@ class App: # export argcomplete.autocomplete(self.__parser, default_completer = NoopCompleter()) - except Exception: - pass + except ImportError: + log(DEBUG, 'argcomplete is not installed, shell completion disabled') + except Exception as e: + log(DEBUG, f'Shell completion disabled: {e}') self.__args = self.__parser.parse_args(args = argv)