GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix fcntl, sslsocket traverse, super , excepthook by youknowone · Pull Request #6623 · RustPython/RustPython

Conversation

@youknowone

@youknowone youknowone commented Jan 1, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

All reactions
@coderabbitai

coderabbitai Bot commented Jan 1, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
📝 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

  • Share more ssl consts and fix openssl  #6462: Directly modifies the same PySSLSocket type declaration and SSL-related traversal semantics.
  • PyPayload::into_ref #3744: Modifies the same setup_context() function in vm/src/warn.rs.
  • PySSLCertificate #6219: Updates PySSLSocket definition in stdlib/src/ssl.rs with certificate handling integration alongside traversal changes.

Suggested reviewers

  • ShaharNaveh
  • arihant2math

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
  • 📝 Generate docstrings

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
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands and usage tips.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
youknowone force-pushed the manifix branch from 7c0d610 to bc7e50e Compare January 2, 2026 03:07
@github-actions

github-actions Bot commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

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:

git pull origin manifix
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone added 4 commits January 2, 2026 23:22
@youknowone
fix fcntl
c00fd03
@youknowone
fix traverse
cc3287b
@youknowone
fix super
f9f1b09
@youknowone
excepthook
3942072
@youknowone
youknowone force-pushed the manifix branch from 1c21e0a to 6f168bf Compare January 2, 2026 14:32
@youknowone
fix warn
c0489c6
@youknowone
youknowone force-pushed the manifix branch from 6f168bf to c0489c6 Compare January 2, 2026 14:36
@youknowone
youknowone marked this pull request as ready for review January 2, 2026 14:37
@youknowone youknowone changed the title various bug fixes fix fcntl, sslsocket traverse, super , excepthook Jan 2, 2026
@youknowone
youknowone merged commit 0eddee5 into RustPython:main Jan 2, 2026
13 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@youknowone
youknowone deleted the manifix branch January 2, 2026 15:15
This was referenced Jan 18, 2026
better ssl write handling #6763
Merged
FromArgs with error_msg #6804
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Feb 6, 2026
Refactor warn.rs and _warnings module #7023
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Feb 17, 2026
Use _print_exception_bltin in excepthook, register source in linecache #7177
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

1 participant

@youknowone
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.