Skip to content

Report fatal explicit-home startup failures - #9227

Merged
youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:split/explicit-home-startup-315
Oct 20, 2026
Merged

youknowone merged 2 commits into
RustPython:mainfrom
youknowdot:split/explicit-home-startup-315

Conversation

@youknowdot

Copy link
Copy Markdown
Contributor

Summary

Extract the explicit-PYTHONHOME startup failure closure from the Python 3.15 upgrade:

  • Retain a failed initial encodings import when an explicit standard-library home was configured.
  • Before CLI scope/site/user-code execution, print the path configuration and report a fatal startup error with the original exception as its cause. SystemExit(0) and SystemExit(None) from that import cannot turn failed initialization into a successful command.
  • Preserve the recorded error in worker-VM templates. Default/implicit-path fallback is unchanged; embedding applications can opt into the check. An embedding application explicitly setting a bad home now retains the failure rather than immediately printing the old fallback warning.
  • Retire the existing canonical test_dump_path_config expected failure after paired verification, using the unchanged updater and preserving all other markers/local adaptations.

Four files; no parser, CAPI error-state, updater, workflow, or new repository test body. Based on main c08375b. Contributor #8732's implicit RUSTPYTHONPATH warning-text work is not duplicated.

Validation

Fresh sqlite+CAPI release at native checkpoint4e089097; final3167502f changes only the verified test marker. Normal hooks and source audits pass.

  • Historical main58b54 baseline fails the unchanged canonical startup test; candidate and pinned CPython3.15.0 d220409a13b77de7a6c30abe16ea90db01528edc pass. The relevant startup/configuration/test inputs are unchanged between that baseline and this PR's main base.
  • Private, bounded encodings fixtures raising SystemExit(0/None): baseline exits0 and executes the user command. Candidate and CPython exit1, retain the SystemExit cause, and do not execute the command.
  • Default startup, -E/-I ignoring invalid home, and valid-home frozen off/on controls pass on all three runtimes. These are behavioral observations, not a claim that every diagnostic byte matches CPython.
  • Selected canonical test_cmd_line: candidate80 cases (42 passed,23 skipped,15 existing expected failures); oracle80 (68 passed,12 skipped). The existing asyncio-debug case is excluded externally from local execution because it creates an AF_UNIX socketpair; no source skip was added.
  • Complete canonical test_importlib.frozen:30 passed on both.
  • Workspace tests: 1,401 passed, 18 ignored. CAPI tests: 123 passed, 4 ignored. Workspace and CAPI strict Clippy passed. All source/protected audits restored clean.

Local validation is Linux. The ordinary embedding constructor remains nonfatal unless its host calls the new check; its no-stdio/fallback behavior was reviewed in source, with existing native/CAPI gates providing their normal coverage rather than a new dedicated embedding fixture. Test data and environment changes were restricted to owned children/private temporary directories. Canonical assertion bodies were not modified.

AI assistance

OpenAI Codex assisted with implementation, independent source review, canonical regeneration, automated validation, and this description under the maintainer's requested Python 3.15 upgrade work. The checks described were automated, not manual human testing. Commits include the assistance trailer; maintainer review is still needed.

Retain explicit standard-library initialization errors for the command-line host, preserving default embedding fallback and the original exception cause.

Assisted-by: OpenAI Codex: model version unavailable
Retire the verified expected failure through update_lib, preserving the explicit local path-environment adaptation and all other markers.

Assisted-by: OpenAI Codex: model version unavailable
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ad1a40ca-5340-469b-a307-aefb1d39ec32
📥 Commits

Reviewing files that changed from the base of the PR and between c08375b and 3167502.

⛔ Files ignored due to path filters: 1
  • Lib/test/test_cmd_line.py is excluded by !Lib/**
📒 Files selected for processing: 3
  • crates/vm/src/vm/mod.rs
  • crates/vm/src/vm/thread.rs
  • src/lib.rs
+-------------------------------------------------+
| Code Wars Episode II: Attack of the Git Clones. |
+-------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • 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

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

@github-actions

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
:4: SyntaxWarning: invalid decimal literal
:7: SyntaxWarning: "\z" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\z"? A raw string is also an option.
:10: SyntaxWarning: "\400" is an invalid octal escape sequence. Such sequences will not work in the future. Did you mean "\400"? A raw string is also an option.
[ ] test: cpython/Lib/test/test_cmd_line.py (TODO: 18)

dependencies:

dependent tests: (no tests depend on cmd_line)

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

@codspeed

codspeed Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:split/explicit-home-startup-315 (3167502) with main (c08375b)

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 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be useful

@youknowone
youknowone marked this pull request as ready for review October 20, 2026 00:27
@youknowone
youknowone merged commit 1be1628 into RustPython:main Oct 20, 2026
32 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-10-20T00:34:05.482828Z 3167502 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.

2 participants