Summary
In promising/promise.py, the _ensure_from_loop_full_unpacking_scheduled_wrapper method catches BaseException, which intercepts KeyboardInterrupt and SystemExit. This converts them into stored Promise failures instead of allowing shutdown signals to propagate normally.
Details
This callback runs on the event-loop thread. Catching BaseException will intercept KeyboardInterrupt and SystemExit, converting them into stored Promise failures instead of allowing shutdown to propagate. The handler should use except Exception to catch only application exceptions.
Suggested Fix
try:
self._ensure_from_loop_full_unpacking_scheduled()
except Exception as exc:
self._force_internal_error_finish_from_loop(exc)
References
Reported by @coderabbitai, requested by @teremterem.
Summary
In
promising/promise.py, the_ensure_from_loop_full_unpacking_scheduled_wrappermethod catchesBaseException, which interceptsKeyboardInterruptandSystemExit. This converts them into stored Promise failures instead of allowing shutdown signals to propagate normally.Details
This callback runs on the event-loop thread. Catching
BaseExceptionwill interceptKeyboardInterruptandSystemExit, converting them into stored Promise failures instead of allowing shutdown to propagate. The handler should useexcept Exceptionto catch only application exceptions.Suggested Fix
References
Reported by @coderabbitai, requested by @teremterem.