fix: script pull abort and async generator cleanup#212
Merged
KadirBalku merged 2 commits intoviur-framework:mainfrom May 5, 2026
Merged
fix: script pull abort and async generator cleanup#212KadirBalku merged 2 commits intoviur-framework:mainfrom
script pull abort and async generator cleanup#212KadirBalku merged 2 commits intoviur-framework:mainfrom
Conversation
…n()` `asyncio.new_event_loop().run_until_complete()` skips `shutdown_asyncgens()`, so async generators (e.g. `TreeModule.list`) that are not fully exhausted have their `aclose()` scheduled but never awaited. This produces a `RuntimeWarning` on Python 3.12+ and causes functional breakage on Python 3.14. `asyncio.run()` calls `loop.shutdown_asyncgens()` before closing, fixing the cleanup.
When `click.confirm()` receives an EOF (non-interactive stdin) or the user presses Ctrl+C, it raises `click.exceptions.Abort`. Previously this propagated out of `process_entry` and aborted the entire pull, leaving all remaining files unpulled. Catch the exception per-file and skip to the next entry instead.
script pull abort and async generator cleanup on Python 3.12+script pull abort and async generator cleanup
ArneGudermann
approved these changes
May 5, 2026
KadirBalku
approved these changes
May 5, 2026
Collaborator
KadirBalku
left a comment
There was a problem hiding this comment.
looks fine so far thank you
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.
Problems
1.
new_event_loop().run_until_complete()skips async generator cleanupAs the Python docs note:
asyncio.run()additionally callsloop.shutdown_asyncgens()before closing, whichrun_until_complete()does not.Async generators (e.g.
TreeModule.list) that are not fully exhausted have theiraclose()scheduled but never awaited, producing aRuntimeWarning.2.
click.Abortduring overwrite prompt aborts the entire pullclick.confirm()raisesclick.exceptions.Abortwhen it receives EOF (non-interactive stdin, e.g. scripts or some IDEs) or the user presses Ctrl+C.Previously this propagated uncaught out of
process_entry, aborting the whole pull and leaving all remaining files unpulled.Fixes
asyncio.new_event_loop().run_until_complete()calls withasyncio.run()(get_modules,pull,push,run)click.exceptions.Abortper file inscript pulland skip to the next entry instead of aborting