Repository navigation
Align hashlib and HMAC with Python 3.15 - #9170
Conversation
Warn on the deprecated shared string keyword and refresh the complete hashing libraries, canonical suites, and shared helper from CPython v3.15.0 (d220409a13b77de7a6c30abe16ea90db01528edc) with update_lib. Keep the six-file family independent and add no RustPython test guards. Assisted-by: OpenAI Codex:model version unavailable
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters: 5
📒 Files selected for processing: 1
✨ Finishing Touches
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: :4: SyntaxWarning: invalid decimal literal dependencies:
dependent tests: (147 tests)
[x] lib: cpython/Lib/hmac.py dependencies:
dependent tests: (9 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: 45a113b513
ℹ️ 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".
| self.assertRaises(TypeError, get_builtin_constructor, 3) | ||
| # ensure that the exception message remains consistent | ||
| err = re.escape("new() argument 'name' must be str, not int") | ||
| self.assertRaises(TypeError, err, get_builtin_constructor, 3) |
There was a problem hiding this comment.
Restore the constructor as the callable under test
When this test runs, assertRaises treats its second argument as the callable, but this changed line passes the regex string err; it therefore catches the resulting 'str' object is not callable TypeError and never executes get_builtin_constructor(3). The test now remains green even if the constructor accepts invalid names, so restore get_builtin_constructor as the second argument.
AGENTS.md reference: AGENTS.md:L276-L282
Useful? React with 👍 / 👎.
Summary
string=argument, including warning-as-error propagation.d220409a13b77de7a6c30abe16ea90db01528edc). This includes SHAKE rejection in HMAC fallback paths and consistent unavailable-algorithm behavior.scripts/update_lib; no new test guards, assertion changes, or unrelated support-suite refresh.Verification
All local gates passed on the unchanged final source:
test_hashlib: 88 tests, 15 standard skips; full canonicaltest_hmac: 146 tests, 46 standard skips. Both ran with-u none; CPU-heavy, bigmem and remote-vector resources were disabled. The normal fast threaded hashing, scrypt, constructor-warning and argument-error cases passed. HMAC's skips also include unavailable_hmac/_sha2backends.test_secrets: 11 tests passed.crates/capi: 123 passed, 4 existing ignores.--all-targets -- -D warnings), and nonthreading VM compilation passed.Cargo builds and tests used the locked dependency graph, two jobs, disabled incremental compilation, and serialized execution. The release interpreter was built from this source; native test inventories were checked before execution.
Seven other shared-helper consumers retain compatible decorator calls. Their socket/process suites are outside this focused local run.
test_supportdoes not use the hashing helper and remains unchanged, preserving its existing RustPython-specific isolation coverage.Provenance and assistance
This is an independent split from #8954, based directly on main, without taking unrelated recovery changes.
Pinned upstream files: hashlib.py, hmac.py, test_hashlib.py, test_hmac.py, hashlib_helper.py.
AI-assisted by OpenAI Codex (model version unavailable): source comparison, implementation, canonical migration, local verification, and PR preparation.