GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Match startup pycache prefix and debug flag configuration by youknowdot · Pull Request #9492 · RustPython/RustPython

Conversation

@youknowdot

@youknowdot youknowdot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

  • Initialize sys.pycache_prefix from PYTHONPYCACHEPREFIX or the first -X pycache_prefix option, respecting -E/-I and explicit empty or bare overrides.
  • Preserve filesystem path bytes through OsString and the existing native fsdecode path, without adding a codec bootstrap dependency.
  • Normalize the startup parser-debug flag to Boolean, matching CPython's configuration roundtrip.
  • Restore the canonical test_sys_flags_set and test_set_pycache_prefix methods with scripts/update_lib, retaining the other RustPython adaptations.

CPython basis

CPython 3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc):

  • Python/initconfig.c:config_init_pycache_prefix and Python/preconfig.c:_Py_get_xoption: first explicit option, empty/bare suppression, environment fallback.
  • parser_debug is a Boolean config member, normalized by config_get → _PyConfig_AsDict → getpath's _PyConfig_FromDict roundtrip.
  • Existing Lib/importlib/_bootstrap_external.py consumes the mutable sys.pycache_prefix attribute. 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-environment dont_write_bytecode=0 canonical 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 in test_compileall: test_no_args_compiles_path and test_no_args_respects_force_flag inherited by both source-epoch classes. All four passed in both the initial run and rerun on macOS, Ubuntu, and Windows. The follow-up uses scripts/update_lib to remove the two obsolete base-method decorators; test_compileall.py is 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@codex
Match startup pycache prefix and debug flag configuration
fd37a94
Restore canonical command-line configuration tests through update_lib and preserve undecodable environment paths with filesystem decoding.

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

coderabbitai Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters: 1
  • Lib/test/test_compileall.py is excluded by !Lib/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

Run configuration
  • Source mode: Auto
  • Repository: RustPython/RustPython
  • Branch: main
  • File: .coderabbit.yml
  • Commit: a838216
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 155f6a12-448c-43c2-be45-2f89dc5766bb

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
  • Source mode: Auto
  • Repository: RustPython/RustPython
  • Branch: main
  • File: .coderabbit.yml
  • Commit: a838216
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 196d499f-e7b2-4eb3-ac15-f9be8726747f
Commits

Reviewing files that changed from the base of the PR and between a838216 and fd37a94.

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/stdlib/sys.rs
  • crates/vm/src/vm/setting.rs
  • src/settings.rs

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

Walkthrough

The changes add pycache_prefix to settings, populate it from environment variables and the -X option, and expose it through sys.pycache_prefix. They also normalize the debug setting to 0 or 1.

Changes: Cache prefix configuration

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 add sys.pycache_prefix and 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: Passed 5
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 both main changes: startup pycache-prefix handling and debug-flag configuration.
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 with cyclomatic complexity of at least 2. Documentat…
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.
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.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

📦 Library Dependencies

The 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
[x] test: cpython/Lib/test/test_compileall.py

dependencies:

  • compileall

dependent tests: (1 tests)

  • compileall: test_compileall

Legend:

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone approved these changes Oct 30, 2026
View reviewed changes
@youknowone
youknowone marked this pull request as ready for review October 30, 2026 23:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 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 ⚠️ Failed 2026-10-30T23:30:01.591917Z
We couldn’t complete this review. Comment @codex review to try again.
fd37a94 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codex
Restore compileall tests passing with pycache prefix
f83021b
Remove obsolete expected failures through update_lib after initial and rerun successes on all three CI platforms.

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

codspeed Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 62 untouched benchmarks
⏩ 4 skipped benchmarks1


Comparing youknowdot:python315-startup-config-20261030 (f83021b) with main (b7e6e58)

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

youknowone
youknowone approved these changes Oct 31, 2026
View reviewed changes
@youknowone
youknowone merged commit 8051c05 into RustPython:main Oct 31, 2026
30 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@youknowdot youknowdot mentioned this pull request Oct 31, 2026
Preserve native trailing command-line argument bytes #9494
Merged
@coderabbitai coderabbitai Bot mentioned this pull request Nov 5, 2026
Snapshot startup filesystem encoding on Linux #9689
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@youknowone youknowone youknowone approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@youknowdot @youknowone @codex
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.