Skip to content

Match epoll.modify keyword and eventmask conversion contracts - #9554

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-epoll-modify-signature-20261102
Nov 3, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-epoll-modify-signature-20261102

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

Accept both fd and eventmask as positional or keyword arguments to select.epoll.modify, matching CPython 3.15.0's (self, /, fd, eventmask) signature.

Bind raw arguments before calling user code. After argument-shape validation, retain the order: file-descriptor conversion, event-mask __index__ conversion, any range warning, closed-epoll check, existing host operation. The mask uses the low 32 bits; values outside [-2**31, 2**32 - 1] emit DeprecationWarning("integer value out of range") at stack level 1. A warning promoted to an exception returns before the closed check or syscall. No descriptor ownership changes are introduced.

This changes only modify; it is independent of #9553 (unregister) and does not change register. The small mask helper is local to select; no shared-converter refactor is included. Existing shared Fildes differences, including the missing RuntimeWarning for a direct bool descriptor, are not addressed.

Reference

CPython 3.15.0 select Clinic wrapper and PyLong_AsNativeBytes.

Validation

  • Independent source review, normal commit hooks and git diff --check passed.
  • Added a pure Rust metadata test for both required parameters, arity, keyword-call flag and generated signature. It has not yet been compiled or executed locally.
  • Offline workspace/C-API tests, Clippy and test_epoll attempts were blocked before compilation by the unavailable parking_lot_core git dependency. No local compilation or runtime pass is claimed.
  • Existing Lib/test/test_epoll.py covers positional modify and closed-epoll behavior. It does not establish new keyword handling, mask boundaries, warning-as-error behavior or callback ordering by execution; those remain runtime validation gaps.
  • No unsafe descriptor probes were run. No Lib tests or workflows were changed. Generic binder diagnostic wording and all combinations of malformed-call error priorities are not claimed identical to CPython.

Draft pending exact-head CI and its actual --signature report.

AI assistance: OpenAI Codex performed source investigation, implementation, metadata-test drafting and review.

Bind raw arguments before callbacks and preserve Clinic bitmask warning semantics.

Assisted-by: OpenAI Codex:model version not exposed
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@codspeed

codspeed Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:fix-epoll-modify-signature-20261102 (073bbf3) with main (016cdff)

Open in CodSpeed

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@youknowone
youknowone marked this pull request as ready for review November 3, 2026 04:05
@youknowone
youknowone merged commit 500b774 into RustPython:main Nov 3, 2026
29 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T04:10:22.599898Z 073bbf3 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

3 participants