cli: avoid panic when -X int_max_str_digits has no value - #8677
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2193a15c7b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for option in ( | ||
| "int_max_str_digits", | ||
| "int_max_str_digits=639", | ||
| "int_max_str_digits=invalid", | ||
| ): |
There was a problem hiding this comment.
Remove the newly added test logic
This new snippet introduces test assertions, control flow, and test data, but the repository rules state that test assertions, logic, and data must not be modified and limit acceptable test-file changes to adding or removing expected-failure markers. Remove this test-file addition and keep the behavioral fix confined to the Rust implementation.
AGENTS.md reference: AGENTS.md:L273-L279
Useful? React with 👍 / 👎.
Merging this PR will degrade performance by 12.48%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | gc_collect.py[rustpython] |
206.6 ms | 236.1 ms | -12.48% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cuishuang:main (2193a15) with main (c6c1b1c)
youknowone
left a comment
There was a problem hiding this comment.
Thank you for contributing! Please check lint failuire
https://github.com/RustPython/RustPython/actions/runs/34241535912/job/102112661455?pr=8677
clicking prek run will show you what's failing.
Everything others looks great. Thanks!
Signed-off-by: cuishuang <imcusg@gmail.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |

Summary
Passing
-X int_max_str_digitswithout a value unwrapsNoneand causes a Rust panic before reaching the existing configuration error handler.Handle the optional value before parsing so missing values report the existing
invalid limitdiagnostic and exit with status 1.AI assistance: Codex (GPT-6) assisted with the regression test, validation, and I have reviewed and understand the code.
Summary by CodeRabbit
Bug Fixes
-X int_max_str_digitsvalues now produce a clear error instead of causing an interpreter panic.640and0, continue to be accepted and reported correctly.Tests