Repository navigation
Synchronize developer tools with Python 3.15 - #9298
youknowone merged 1 commit into
Conversation
Regenerate bdb, pdb, codeop, modulefinder and the canonical modulefinder test using scripts/update_lib at CPython 3.15.0 d220409a13b77de7a6c30abe16ea90db01528edc. AI-assisted source selection, synchronization, dependency review and bounded validation using OpenAI Codex. Assisted-by: Codex:unknown
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 5
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [x] lib: cpython/Lib/codeop.py dependencies:
dependent tests: (112 tests)
[x] lib: cpython/Lib/modulefinder.py dependencies:
dependent tests: (2 tests)
[x] lib: cpython/Lib/pdb.py dependencies:
dependent tests: (1 tests)
[x] lib: cpython/Lib/bdb.py dependencies:
dependent tests: (2 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e15601f84
ℹ️ 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".
| def test_namespace_package(self): | ||
| self._do_test(namespace_package_test) |
There was a problem hiding this comment.
Remove the prohibited test-case addition
This adds executable test logic and accompanying test data even though the repository's critical test policy limits test-file changes to adding expected-failure decorators or removing them when tests pass; adding a new canonical regression case is not one of the permitted changes. Keep Lib/test/test_modulefinder.py unchanged and validate this behavior through permitted implementation-focused checks.
AGENTS.md reference: AGENTS.md:L276-L282
Useful? React with 👍 / 👎.
| if isinstance(pathname, importlib.machinery.NamespacePath): | ||
| m.__path__ = pathname |
There was a problem hiding this comment.
Snapshot namespace paths in ModuleFinder
When analyzing a nested namespace such as a.b, ModuleFinder.find_module() passes only the part name (b) into _find_module(), so retaining this object gives it an internal name of b rather than a.b. At the next PathFinder.invalidate_caches(), it recalculates from global sys.path; if an unrelated top-level namespace b is present, a.b.__path__ changes from .../a/b to .../b and import a.b.c is incorrectly reported missing. Snapshot the discovered locations, or otherwise preserve ModuleFinder's fully qualified parent context, before assigning __path__.
Useful? React with 👍 / 👎.
| from _pyrepl.simple_interact import run_multiline_interactive_console | ||
| self.message(banner) | ||
| try: | ||
| run_multiline_interactive_console(console) |
There was a problem hiding this comment.
Restore PyRepl globals after interact exits
When a TTY-hosted script, rather than an already-running PyRepl, enters Pdb, runs interact, and then resumes, this helper calls _pyrepl.readline._setup() (Lib/_pyrepl/readline.py:610-646), which replaces builtins.input and installs a completer holding the stopped-frame namespace without any teardown. Exiting the interact console therefore permanently changes subsequent input() calls and leaves stale retained completion state; use the instance's existing reader or restore PyRepl's process-global state in a finally block.
Useful? React with 👍 / 👎.
| 'stdin': self.pyrepl_input, | ||
| 'use_rawinput': False, | ||
| 'prompt': '', |
There was a problem hiding this comment.
Preserve nested debugger prompt state
When PyRepl is active, this clears self.prompt for the whole command dispatch, but nested loops are entered before the context exits: do_debug() builds its child prompt from the now-empty value and passes self.stdin (a wrapper bound to the outer Pdb), while do_commands() sets (com) yet the wrapper continues to render its fixed (Pdb) prompt and outer completions. Thus recursive and breakpoint-command sessions display incorrect prompts and complete against the wrong debugger; keep the logical prompt intact and suppress only cmd.Cmd's direct rendering, or rebind the wrapper per nested loop.
Useful? React with 👍 / 👎.
Summary
Sync a coherent set of developer tools to CPython 3.15.0 (
d220409a13b77de7a6c30abe16ea90db01528edc) usingscripts/update_lib:pdb's canonical input/pyrepl integration, rc-path deduplication, initial state and command/display handling.bdb's Python trace dispatcher, matching the existing native separation of trace and profile events.modulefinder, including the canonical regression test and explicitcompile(module=...)context.codeop's unused exception-binding cleanup.All five changed files are byte-identical to the pinned upstream sources. Existing
test_pdb/test_bdbadaptations are untouched. This splits the corresponding Lib changes from #8954; it does not add remote debugger support or change native code.Existing prerequisites
Current main already exports
importlib.machinery.NamespacePath, acceptscompile(module=...), filters C events out ofsys.settrace, and provides the pyrepl APIs used by the synchronized debugger.Validation
test_namespace_package,test_package,test_maybe, with no skips. Execution used an isolated owned temporary tree and resource limits.test_pyrepl_availablepasses against the hash-pinned canonical helper with inert modules; no real terminal discovery orPdbconstruction. This upstream test is not present in retained currenttest_pdb.find_function/find_first_executable_line; fixture code is compiled/disassembled, never executed. This is external finite validation, not a canonical test added to the repository.No broad
test_pdb/test_bdbrun, interactive TTY integration, arbitrary rc execution, live tracing/attach or remote debugging was exercised. Source prerequisite review and compile-only validation do not prove those behaviors. The extracted/mocked checks above cover only their named helper paths, not the whole debugger.AI assistance
OpenAI Codex assisted with source selection,
scripts/update_libsynchronization, dependency review, bounded validation and this PR description. The changed library/test files are exact pinned CPython sources, not newly generated implementations. The model identifier is unavailable.