Skip to content

Keep REPL history-save errors from replacing exit status - #9081

Merged
youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-repl-history-main-oct11
Oct 11, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
youknowdot:fix-repl-history-main-oct11

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Restore #9078 onto main. That PR was accidentally merged into stack/python-3.15-8950; this follow-up contains only its two-line src/shell.rs fix in one commit based directly on current main.

Treat saving REPL history as best effort on EOF and SystemExit, preserving normal exit status when the history path cannot be written.

Validation

  • The complete changed src/shell.rs blob is identical to the reviewed Keep REPL history failures from changing exit status #9078 fix; no other files or staging-branch changes are included.
  • Pre-commit checks passed, including rustfmt and cspell; git diff --check passed.
  • Earlier identical-patch testing passed eight isolated Linux REPL/reference cases: writable and ENOTDIR history paths, each with EOF and SystemExit(7). Those runtime results belong to the earlier build, not this new main-based commit.
  • Fresh hosted CI is enabled for this commit and will be checked before merging. No CI-skip marker is present.

AI assistance: OpenAI Codex prepared this restoration and checked its scope and prior evidence.

Summary by CodeRabbit

  • Bug Fixes
    • The REPL no longer crashes if saving command history fails when exiting.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 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-11T13:00:25.640810Z 109ea4e New commits
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbb95a37-08c7-43f0-a32e-920e8029c091

📥 Commits

Reviewing files that changed from the base of the PR and between f194668 and 109ea4e.


You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: RustPython/RustPython/.coderabbit.yml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc9271d3-1040-4a66-ae57-ab9bccc474b7


📥 Commits

Reviewing files that changed from the base of the PR and between 06007c8 and f194668.



📒 Files selected for processing (1)
  • src/shell.rs


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

run_shell now ignores history-save errors before returning a SystemExit exception and after the loop ends.

Changes

Shell history handling

Layer / File(s) Summary
Handle history-save errors on exit
src/shell.rs
Both exit paths discard history-save errors instead of panicking when a save fails.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: youknowone



Merge Risk: ⚪ Minimal · up to f1946

History-save failures no longer replace a requested SystemExit status or turn normal shell exit into a panic. No actionable merge risk remains from the reviewed change.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: history-save errors no longer replace the REPL exit status.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.



✨ 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.

@youknowone
youknowone enabled auto-merge (squash) October 11, 2026 04:17
@youknowone
youknowone disabled auto-merge October 11, 2026 04:17
Restore the two-line fix from RustPython#9078 onto main after it was merged into the Python 3.15 staging branch.

Assisted-by: OpenAI Codex:model identifier unavailable
@youknowdot
youknowdot force-pushed the fix-repl-history-main-oct11 branch from f194668 to 109ea4e Compare October 11, 2026 12:58
@youknowone
youknowone merged commit 4e3b2f4 into RustPython:main Oct 11, 2026
29 checks passed
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