Fix reflash callback ownership and error handling - #259
Open
drebbe-intrepid wants to merge 1 commit into
Open
drebbe-intrepid wants to merge 1 commit into
drebbe-intrepid wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #241.
set_reflash_callback()now owns its registered handler until replacement or unregistration and keeps an in-flight reference so callbacks can safely unregister themselves. Invalid handlers and failed symbol lookup preserve the existing registration. Progress callbacks release their return values and report exceptions throughsys.unraisablehook; Unicode conversion also works on CPython 3.14. Existing callable,reflash_callbackmethod, no-argument stdout, andNonedisable modes remain supported.Validation: rebuilt the extension on Windows x64 with CPython 3.14.5 and 3.12.10; all 42 tests passed on each, including 12 new hardware-free native mock cases. The lifetime regression failed against the original build. Coverage includes dropped owner, replacement, unregistration, self-unregistration, invalid handlers, attribute errors, missing native symbol, result cleanup, exceptions, Unicode stdout, worker-thread delivery, and delivery during registration. No hardware operations performed.
Independent critic
/root/criticexplicitly agreed with the final diff and independently ran all 42 tests. Builder also explicitly agreed before publication. Reviewed commit:7b74272a35bf5380fdf121583d472bd710032149(identical reviewed blobs). Parent coordinator retains CI acceptance, integration, hardware testing, and merge responsibility.