Repository navigation
Align filesystem archives and bytecode compilation with Python 3.15 - #9191
youknowdot wants to merge 1 commit into
Conversation
Refresh the connected pathlib, glob, zipfile, tempfile, py_compile and compileall closure from CPython 3.15.0 while preserving existing RustPython test guards. Assisted-by: OpenAI Codex:model version unavailable
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters: 26
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 |
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: 6a9afbe374
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -393,36 +392,6 @@ def test_glob_many_open_files(self): | |||
| for it in iters: | |||
| self.assertEqual(next(it), p) | |||
|
|
|||
There was a problem hiding this comment.
This hunk deletes the complete test_glob0 and test_glob1 cases, but the repository rules explicitly prohibit deleting test lines and limit test-file changes to adding or removing expected-failure markers; preserve the cases (or update their status) instead of dropping their coverage.
AGENTS.md reference: AGENTS.md:L274-L283
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
These deletions follow the authorized CPython 3.15 source synchronization rather than removing coverage for retained APIs. The pinned upstream revision removes the deprecated public glob.glob0/glob.glob1 wrappers and their corresponding tests together; the private _glob0/_glob1 implementation helpers remain. Restoring these tests would exercise APIs that no longer exist in Python 3.15. Both files were migrated through scripts/update_lib, preserving the existing RustPython guards. Sources: https://github.com/python/cpython/blob/d220409a13b77de7a6c30abe16ea90db01528edc/Lib/glob.py and https://github.com/python/cpython/blob/d220409a13b77de7a6c30abe16ea90db01528edc/Lib/test/test_glob.py . The candidate glob suite passes locally (22 cases, 2 inherited skips).
| raise | ||
|
|
||
| # fullpath is path as seen from the working directory | ||
| fullpath = fullname + path[len(name):] |
There was a problem hiding this comment.
Normalize byte paths before cleanup recovery
When TemporaryDirectory is constructed with a bytes-valued prefix, suffix, or dir and cleanup enters this PermissionError recovery on POSIX, fd-based shutil.rmtree has decoded its callback path to str while name and fullname remain bytes; this concatenation raises TypeError before ignore_cleanup_errors can apply and leaves the directory behind. Normalize the operands to the same path type before deriving fullpath.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed with a private-filesystem reproduction on both the candidate and CPython 3.15: a bytes-valued TemporaryDirectory dir plus a non-writable child directory makes permission recovery raise TypeError, even with ignore_cleanup_errors=True. The installed CPython tempfile.py and shutil.py match the pinned d220409a13b77de7a6c30abe16ea90db01528edc sources byte-for-byte. The failing concatenation was added in the upstream race-fix backport python/cpython#158431 (original python/cpython#157580). An English upstream bug-report draft with a non-root POSIX reproduction and captured CPython traceback has been prepared for the user; no upstream issue has been filed. Per the requested pinned-source policy, this PR keeps the canonical source unchanged rather than adding a local deviation. This finding is separate from the still-running CI checks.
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: :4: SyntaxWarning: invalid decimal literal dependencies:
dependent tests: (120 tests)
[x] lib: cpython/Lib/compileall.py dependencies:
dependent tests: (1 tests)
[x] lib: cpython/Lib/pathlib dependencies:
dependent tests: (171 tests)
[x] lib: cpython/Lib/tempfile.py dependencies:
dependent tests: (95 tests)
[x] lib: cpython/Lib/glob.py dependencies:
dependent tests: (81 tests)
[x] lib: cpython/Lib/py_compile.py dependencies:
dependent tests: (46 tests)
Legend:
|
Summary
Split the connected filesystem/archive and bytecode-compilation library refresh out of #8954.
d220409a13b77de7a6c30abe16ea90db01528edc):glob,pathlib/_os/types,zipfile/_path/_functools,tempfile,py_compile, andcompileall.compilealldepends on bothpathlib.Pathandpy_compile;PyZipFileuses the same native importlib bytecode writer.scripts/update_lib, preserving all eight existing RustPython guards. No new skips, expected failures, snippets, or native code changes.Validation
cargo build --locked --offline --release: passed.test_glob: 22 cases, 2 skipped.test_pathlib: 1,394 selected cases, 407 skipped.test_zipfile: 386 cases, 37 skipped, 4 existing expected failures.test_tempfile: 121 cases, 9 skipped.test_py_compile: 34 cases.test_compileall: 139 selected cases, 6 skipped, 2 existing expected failures.All six suites passed: 2,096 reported cases, including 461 existing skips and 6 expected failures. Native sources are unchanged; the full Rust workspace/C-API suites were not rerun for this library-only extraction.
Local validation uses a fresh release build from this exact worktree. Normal,
-E, and-Istartup checks verify that the interpreter and its isolated children use this checkout'sLib. Child cache writes are allowed, then audited and preserved in a separate quarantine; source files remain unchanged.The local pathlib selection excludes Unix-socket creation. The compileall selection excludes its six inherited real-multiprocessing cases, whose forkserver uses Unix sockets. Existing optional-platform/resource skips remain. The existing CI selections are unchanged. Windows, macOS, and frozen-stdlib behavior are not claimed as locally verified.
The pinned upstream
PyZipFile._get_codecurrently does not forward its stored optimization setting tosource_to_code; this PR does not claim to fix that behavior. Existing PyZipFile expected failures are retained.AI disclosure
OpenAI Codex (model version unavailable) assisted with dependency analysis, updater-driven extraction, independent source review, validation, and this PR description. The commit includes the required
Assisted-bytrailer.