Repository navigation
Match hashlib constructor name type diagnostics - #9066
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No identified issue blocks merging after normal checks. Pre-merge checks |
|
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: c2a9d84ecf
ℹ️ 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".
| dict.into() | ||
| } | ||
|
|
||
| #[derive(Debug)] |
There was a problem hiding this comment.
Add the required AI-assistance trailer
This commit is authored by Codex <codex@openai.com>, but the reviewed commit message has no Assisted-by: trailer. Repository policy requires that exact trailer form for every AI-assisted contribution, so add it before this commit is merged.
AGENTS.md reference: AGENTS.md:L23-L23
Useful? React with 👍 / 👎.
| ): | ||
| with assert_raises(TypeError) as caught: | ||
| _hashlib.new(value) | ||
| assert str(caught.exception) == f"new() argument 'name' must be str, not {name}" |
There was a problem hiding this comment.
Remove the prohibited test assertion
This appended loop introduces new test data, test logic, and an assertion in an existing test file. Repository policy explicitly forbids modifying test assertions, logic, or data, so remove this test hunk before merging.
AGENTS.md reference: AGENTS.md:L275-L275
Useful? React with 👍 / 👎.
Merging this PR will not alter performance
Comparing Footnotes
|
Head branch was pushed to by a user without write access
c2a9d84 to
d7ddade
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
d7ddade to
e4f8645
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
e4f8645 to
4c8093d
Compare
4c8093d to
4a41ab5
Compare
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] test: cpython/Lib/test/test_mmap.py (TODO: 19) dependencies: dependent tests: (2 tests)
Legend:
|
Use native type names, None spelling, and UTF-8 byte precision for invalid name arguments without changing accepted strings or hashing behavior. Assisted-by: OpenAI Codex:model identifier unavailable
4a41ab5 to
586fc7d
Compare
Current Python 3.15 main target
#8950 is merged. This PR now targets
mainand replays only its unique commits onto06007c81fa99e813cbf4583dab326764ba0ef017. Current head:4c8093dec7d9366dad4a81fe1abb77f41d621e06. The prior bootstrap commits are not part of this PR's diff.Normal commit hooks, whitespace checks, and independent source/patch-equivalence review passed. The intervening main fixes are preserved and this PR introduces no changes under
Lib/. No new local build or runtime validation is claimed for this rebased head. The maintainer-requested[skip ci]marker remains; full CI is intentionally paused pending selective validation.Prior stack and validation history
The base/head references below describe earlier revisions; the current target and validation limits above supersede them.
Temporary CI pause
The head commit includes
[skip ci]at the maintainer's request. This message-only amendment preserves the exact source tree and commit parents. Normal pull-request CI is intentionally skipped; required checks may remain pending. This does not itself cancel older runs or suppresspull_request_targetworkflows.Python 3.15 stack
Depends on #8950 at
80d3e52f32341d3158c659d82a927373b51b6439. This PR targets the upstreamstack/python-3.15-8950branch at that exact commit, so its displayed diff contains only the leaf changes. Unique changes above #8950.Current head
e4f86457f3ae15def3a3d7b32cece1b73597b215was checked by source/range-diff review, normal commit hooks, and patch checks. Its unique delta changes no files underLib/and inherits the 3.15.0 reference. No new local build or runtime execution is claimed for this stacked head; validation described below applies to the earlier head unless explicitly updated. Exact-head hosted CI is temporarily skipped.Summary
Extract the Python 3.14-compatible
_hashlib.newname-type diagnostic from #8954, correcting the mega implementation's formatting details.For non-string names, report
new() argument 'name' must be str, not TYPE. Match CPython's special spelling for None, stored native type name, and 50-byte UTF-8 precision without splitting a code point. Actual strings retain the existing PyUtf8StrRef conversion. Algorithm selection, hashing, and usedforsecurity behavior are unchanged; the separate 3.15string=deprecation warning is excluded.Sources: 3.14.7 generated parser, 3.14.8 bad-argument diagnostic, and UTF-8 precision handling.
Add six focused cases to the existing hashlib Python snippet, covering None, ordinary builtins, a qualified native type, and ASCII/non-ASCII truncation. No canonical assertions or unrelated diagnostic helpers change.
Validation
-D warnings.All behavior assertions are Python tests. Embedded-NUL handling and broader argument-binding diagnostic precedence are separate pre-existing contracts, not claims of this change. hosted CI is temporarily skipped.
Summary by CodeRabbit
New Features
Bug Fixes
_hashlib.new()now raises aTypeErrorfor non-string algorithm names and identifies the supplied value’s type. Long type names are limited to 50 characters without splitting a UTF-8 character.