From cc9a5e236e784fa4bcbdda996de4c05a060cce5f Mon Sep 17 00:00:00 2001 From: GaltRanch Date: Wed, 1 Apr 2026 13:47:26 -0300 Subject: [PATCH] Handle empty bitcoincli path gracefully instead of crashing When bclock.conf has an empty bitcoincli path, catch the PermissionError and redirect to introINIT() with a helpful error message instead of crashing with 'Fatal error: Permission denied'. Co-Authored-By: Claude Opus 4.6 (1M context) --- pybitblock/PyBlock.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pybitblock/PyBlock.py b/pybitblock/PyBlock.py index fa18e27..d9bd5d3 100644 --- a/pybitblock/PyBlock.py +++ b/pybitblock/PyBlock.py @@ -7407,6 +7407,14 @@ def main(): except KeyboardInterrupt: print("\n") sys.exit(0) + except PermissionError as e: + if str(e).endswith("''"): + show_error("Bitcoin CLI path is not configured. Please set it up.") + logger.error("Empty bitcoincli path in bclock.conf") + introINIT() + else: + logger.error("Fatal error: %s", e) + sys.exit(101) except Exception as e: logger.error("Fatal error: %s", e) sys.exit(101)