Repository navigation
Match startup pycache prefix and debug flag configuration - #9492
youknowdot wants to merge 2 commits into
Conversation
Restore canonical command-line configuration tests through update_lib and preserve undecodable environment paths with filesystem decoding. Assisted-by: OpenAI Codex: model version unavailable
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 1
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including
|
| Layer / File(s) | Summary |
|---|---|
Store and populate the cache prefix crates/vm/src/vm/setting.rs, src/settings.rs |
Settings gains an optional cache-prefix field. A nonempty environment value sets it, and the first -X pycache_prefix option overrides it. |
Expose the cache prefix crates/vm/src/stdlib/sys.rs |
sys.pycache_prefix returns the configured value as a Python string, or None when unset. |
Debug setting normalization
| Layer / File(s) | Summary |
|---|---|
Normalize the debug setting src/settings.rs |
The maximum of the command-line and environment debug counts is mapped to 0 or 1. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
RustPython/RustPython#6839— The changes addsys.pycache_prefixand startup handling for its environment variable and command-line option, which aligns with the issue’s pycache-prefix test objective.
Suggested reviewers: youknowone
Merge Risk: 
Minimal · previous review fd37a
-
The cache-prefix configuration preserves Windows surrogate-containing paths through the existing filesystem decoder. No merge-blocking issue was established; merge after normal checks pass.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 3 files.
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 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.
Comment @coderabbitai help to get the list of available commands.
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] test: cpython/Lib/test/test_cmd_line.py (TODO: 13) dependencies: dependent tests: (no tests depend on cmd_line) [x] lib: cpython/Lib/compileall.py dependencies:
dependent tests: (1 tests)
Legend:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Remove obsolete expected failures through update_lib after initial and rerun successes on all three CI platforms. Assisted-by: OpenAI Codex: model version unavailable
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
sys.pycache_prefixfromPYTHONPYCACHEPREFIXor the first-X pycache_prefixoption, respecting-E/-Iand explicit empty or bare overrides.OsStringand the existing nativefsdecodepath, without adding a codec bootstrap dependency.test_sys_flags_setandtest_set_pycache_prefixmethods withscripts/update_lib, retaining the other RustPython adaptations.CPython basis
CPython 3.15.0 (
d220409a13b77de7a6c30abe16ea90db01528edc):Python/initconfig.c:config_init_pycache_prefixandPython/preconfig.c:_Py_get_xoption: first explicit option, empty/bare suppression, environment fallback.parser_debugis a Boolean config member, normalized byconfig_get→_PyConfig_AsDict→ getpath's_PyConfig_FromDictroundtrip.Lib/importlib/_bootstrap_external.pyconsumes the mutablesys.pycache_prefixattribute. No bytecode path algorithm is replaced.Validation
Passed exact current-source Cargo check, strict Clippy, isolated CLI build, and 29 finite startup configurations against CPython (58 directly owned processes), including an undecodable Unix environment path. Every compared JSON observation matched; input fingerprints remained unchanged and all process groups terminated. Canonical subprocess methods and cross-platform coverage require CI. The no-bytecode-write local matrix uses
-B, so it does not prove the empty-environmentdont_write_bytecode=0canonical case. No full startup parity claim: pre-existing generic numeric environment parsing and non-UTF8 command-line parsing limitations remain separate.AI assistance: OpenAI Codex.
Hosted CI follow-up
The first CI run (
41107874929) exposed four unexpected successes intest_compileall:test_no_args_compiles_pathandtest_no_args_respects_force_flaginherited by both source-epoch classes. All four passed in both the initial run and rerun on macOS, Ubuntu, and Windows. The follow-up usesscripts/update_libto remove the two obsolete base-method decorators;test_compileall.pyis now byte-identical to CPython 3.15.0. No test assertions or runtime code changed. Canonical source comparison, 228 updater tests, and normal commit hooks passed. The new commit requires fresh CI.