Repository navigation
Restore Python 3.15 TextIOWrapper chunk-size deletion semantics - #9082
youknowone merged 1 commit into
Conversation
Check initialization and attachment before rejecting deletion, and use the final reference error message. Preserve initialized, uninitialized, detached, ASCII-subclass, and non-ASCII-subclass regression cases with their exact Python 3.15 outcomes. No bundled Lib files change. Assisted-by: OpenAI Codex:model identifier unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef1197a5e2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert str(error.exception) == ( | ||
| "attribute '_CHUNK_SIZE' of '_io.TextIOWrapper' objects cannot be deleted" | ||
| ) | ||
| assert str(error.exception) == message |
There was a problem hiding this comment.
Preserve the existing snippet assertions
AGENTS.md explicitly forbids deleting test lines or modifying assertions, test logic, or test data, but this replacement changes the expected exception type and message for each existing deletion case (and the following hunk also removes the subclass-name expectation). Rework the change without altering these test assertions rather than updating their oracle alongside the implementation.
AGENTS.md reference: AGENTS.md:L274-L275
Useful? React with 👍 / 👎.
Summary
Restore final Python 3.15
TextIOWrapper._CHUNK_SIZEdeletion behavior after the Python 3.14.8-specific change from #9071 landed alongside #8950.AttributeError("cannot delete attribute")for attached wrappers, including subclasses. Uninitialized and detached wrappers retain their preciseValueErrorcontracts.No files under
Lib/are changed. This is one shared-main correction; it does not duplicate the fix across the existing leaf PRs.Reference: CPython v3.15.0 setter.
Failure evidence
The unrelated workflow-only #8958 fails the CPython 3.15
stdlib_io.pyreference test on Windows and macOS. #9058 shows the same failure on Linux. The assertion was introduced by #9071, not the leaf changes. Other tests in those completed snippet jobs pass.Validation
Candidate:
ef1197a5e2477b719670768089033af1098a41ee, directly on main06007c81fa99e813cbf4583dab326764ba0ef017.ef1197apasses the same bounded existing cases and matches all 12 reference outcomes exactly. All workspace-package artifacts were cleared before rebuilding; the binary reports the expected commit and source/binary fingerprints were recorded.AI assistance
OpenAI Codex assisted with diagnosis, implementation, independent review, and validation. The runtime does not expose a precise model identifier; the commit includes an Assisted-by trailer.