Skip to content

Manage native stream ownership and lifecycle - #266

Closed
sricharanreddycheruku wants to merge 1 commit into
darvid:mainfrom
sricharanreddycheruku:fix-stream-lifecycle
Closed

sricharanreddycheruku wants to merge 1 commit into
darvid:mainfrom
sricharanreddycheruku:fix-stream-lifecycle

Conversation

@sricharanreddycheruku

Copy link
Copy Markdown

Fix native stream object ownership and closure: retain constructor objects,
balance factory/context references, collect cycles and free unclosed native
state. Make close idempotent, reject closed scans or replacing open streams,
preserve end-of-data callback failures and fix Scratch argument parsing.
Document the behavior.

21 new lifecycle cases: 18 fail on original source, three compatibility controls
pass; all pass after the fix. Source-built Python 3.12 suite: 53 pass/two slow
skips. Python 3.10/3.14: 52 pass/three skips (including an existing UTF-8 compiler
limitation), all lifecycle cases pass with PYTHONMALLOC=debug. Combined with
#265: 87 pass/two skips under the debug allocator. clang-format 9, Black, Ruff,
strict docs and diff checks pass. Python 3.9 has an unchanged Py_NewRef build
failure; it was not validated. Independent branch from main.

Retain constructor objects, balance factory and context-manager references, collect cycles, and make native closure explicit and idempotent. Validate closed-stream operations and preserve end-of-data callback failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant