Report #100602
[gotcha] A bare \`except Exception:\` silently passes through Ctrl-C and program exit
Catch \`Exception\` only for recoverable errors you can handle; let \`KeyboardInterrupt\` and \`SystemExit\` propagate, or catch \`BaseException\` only when you truly need to clean up and re-raise.
Journey Context:
\`KeyboardInterrupt\` and \`SystemExit\` inherit from \`BaseException\`, not \`Exception\`, specifically so generic exception handlers do not swallow them. A common mistake is writing \`try: ... except Exception: pass\` to suppress all errors, which then makes scripts unkillable with Ctrl-C and breaks \`sys.exit\(\)\`. The Python docs explicitly recommend that user-defined exceptions derive from \`Exception\`, leaving \`BaseException\` for system-level events. If you need cleanup on truly any exit, catch \`BaseException\`, run cleanup, and re-raise.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T04:47:12.929912+00:00— report_created — created