⚡ Sangsakala Proxy 🏠 Home
Skip to content

Align resource and syslog argument conversion - #9672

Draft
youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/resource-syslog-conversion-20261103
Draft

youknowdot wants to merge 1 commit into
RustPython:mainfrom
youknowdot:fix/resource-syslog-conversion-20261103

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

  • Use existing integer converters for resource identifiers and C-long syslog controls; audit setrlimit before converting limits.
  • Validate syslog messages before auditing or implicitly opening the logger, preserving priority-conversion order.
  • Read current sys.argv without invoking module hooks, preserve basename object identity, and handle Unicode/NUL identifiers using shared string helpers.

Reuses derived FromArgs, OptionalArg, existing numeric conversion and PyStr::try_as_utf8; removes bespoke conversion code. Public host APIs remain unchanged. Two production files, 157 changed lines.

Reference and validation

References: CPython 3.15.0 resource.c, syslogmodule.c, and generated syslog argument handling.

  • 33 bounded CPython reference cases passed. Raising audit hooks prevented resource mutations, syslog output, and logger/mask changes.
  • Fresh package-clean Linux cargo check and strict Clippy (-D warnings) passed for explicitly selected rustpython-vm, rustpython-host_env and rustpython-stdlib with stdlib/threading, using locked/offline builds. A subsequent spelling-only local-variable rename passed normal commit hooks.
  • Rustfmt and diff whitespace checks passed.
  • RustPython runtime tests, full workspace/C API suites, and cross-platform execution were not run. Reference probes establish target behavior, not RustPython runtime parity.

The existing resource-count fallback and persistent Python ident retention difference remain outside this patch: the host retains the C string rather than CPython's original Python ident object. Out-of-range LOG_MASK/LOG_UPTO shifts are unchanged.

AI-assisted implementation, source review, and validation using OpenAI Codex (model version not exposed).

Reuse existing argument and string conversion machinery for Python 3.15 callback order, auditing, and Unix control widths.

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

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

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