GeezerVison is showing github.com — fix fcntl, sslsocket traverse, super , excepthook by youknowone · Pull Request #6623 · RustPython/RustPython
Conversation
youknowone
commented
Jan 1, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary by CodeRabbit
-
New Features
- Added exception hook support for thread operations with improved exception reporting.
-
Bug Fixes
- Improved
ioctl() parameter handling for enhanced platform compatibility.
- Enhanced type validation in
super() builtin with clearer error messages.
- Fixed warning context tracking to accurately report source locations.
- Optimized garbage collection behavior for SSL socket objects.
✏️ Tip: You can customize this high-level summary in your review settings.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Jan 1, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
📝 Walkthrough
Walkthrough
The changes span multiple subsystems: ioctl's parameter type widening from u32 to i64 with runtime bit-pattern casting, SSL socket garbage collection optimization through traversal markers, super() function's type argument validation enhancement, new thread exception hook infrastructure with a dedicated argument class, and warning context setup flow adjustments for frame availability handling.
Changes
| Cohort / File(s) |
Summary |
I/O Control Parameter Handling crates/stdlib/src/fcntl.rs |
Modified ioctl() to accept request as i64 instead of u32, with runtime reinterpretation via cast to u32 then zero-extended to libc::c_ulong to handle negative bit-pattern values. |
SSL Socket Garbage Collection crates/stdlib/src/ssl.rs |
Enabled traverse on PySSLSocket pyclass and marked 10 fields (server_side, server_hostname, connection, handshake_done, session_was_reused, verified_chain, sni_state, client_hello_buffer, shutdown_state, deferred_cert_error) with pytraverse(skip) to exclude them from Python-side GC traversals. |
Super Type Validation crates/vm/src/builtins/super.rs |
Changed InitArgs.py_type field from OptionalArg<PyTypeRef> to OptionalArg<PyObjectRef> and added runtime downcast with type validation; raises error if first argument is not a type. |
Thread Exception Hook Infrastructure crates/vm/src/stdlib/thread.rs |
Added ExceptHookArgs pyclass (_ExceptHookArgs) with four fields (exc_type, exc_value, exc_traceback, thread) and accessor properties; added _excepthook() pyfunction to handle exception hook invocation with traceback printing to appropriate stderr target. |
Warning Context Setup crates/vm/src/warn.rs |
Updated setup_context() control flow: when a frame exists but wasn't stack-discovered, use its globals with filename "<sys>" and lineno 1; added fallback path for no-frame case using sys.__dict__ as globals with lineno 0, replacing prior single fallback using vm.current_globals(). |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~35 minutes
Possibly related PRs
Suggested reviewers
Poem
🐰 Hops with glee through RustPython's halls,
Casting types and marking traversals!
SSL sockets skip through GC's delight,
While super() validates with all its might. ✨
Thread exceptions and warnings align—
A patchwork of fixes, how sublime!
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Docstring Coverage |
✅ Passed |
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
| Title check |
✅ Passed |
The title directly references the four main changes: fcntl fixes, sslsocket traverse fixes, super fixes, and excepthook additions—accurately capturing the pull request's scope. |
✨ 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.
❤️ Share
Comment @coderabbitai help to get the list of available commands and usage tips.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Code has been automatically formatted
The code in this PR has been formatted using cargo fmt --all.
Please pull the latest changes before pushing again:
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
youknowone
changed the title
various bug fixes
fix fcntl, sslsocket traverse, super , excepthook
Jan 2, 2026
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jan 18, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|