Title: Match hashlib constructor name type diagnostics by youknowdot · Pull Request #9066 · RustPython/RustPython · GitHub
Open Graph Title: Match hashlib constructor name type diagnostics by youknowdot · Pull Request #9066 · RustPython/RustPython
X Title: Match hashlib constructor name type diagnostics by youknowdot · Pull Request #9066 · RustPython/RustPython
Description: Current Python 3.15 main target #8950 is merged. This PR now targets main and replays only its unique commits onto 06007c81fa99e813cbf4583dab326764ba0ef017. 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 suppress pull_request_target workflows. Python 3.15 stack Depends on #8950 at 80d3e52f32341d3158c659d82a927373b51b6439. This PR targets the upstream stack/python-3.15-8950 branch at that exact commit, so its displayed diff contains only the leaf changes. Unique changes above #8950. Current head e4f86457f3ae15def3a3d7b32cece1b73597b215 was checked by source/range-diff review, normal commit hooks, and patch checks. Its unique delta changes no files under Lib/ 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.new name-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.15 string= 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 Independent source/ownership review, normal hooks, and native debug build passed. Exact CPython 3.14.7/3.14.8 and native bounded checks agree on 12 type-name diagnostics and an accepted string subclass, including nested/renamed types, blocked Python metadata lookup, and UTF-8 boundaries. The baseline fails the new diagnostic regression. The complete hashlib snippet and both snippet pytest entries pass using the pinned 3.14.7 reference. Four unchanged canonical hashlib tests pass: unknown hashes, uppercase name normalization, name attributes, and Unicode-data rejection. Stdlib and separately configured CAPI Clippy pass with -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 RustPython now targets Python 3.15. Sequence repetition for strings, bytes, and tuples is supported in both operand orders, including in-place multiplication. Bug Fixes _hashlib.new() now raises a TypeError for 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. Improved compatibility for logarithms of large integer-like values, Windows timestamps, CSV dialect errors, struct formats, and other Python 3.15 behaviors. Formatting errors now identify the argument and conversion specifier.
Open Graph Description: Current Python 3.15 main target #8950 is merged. This PR now targets main and replays only its unique commits onto 06007c81fa99e813cbf4583dab326764ba0ef017. Current head: 4c8093dec7d9366dad4a81fe1a...
X Description: Current Python 3.15 main target #8950 is merged. This PR now targets main and replays only its unique commits onto 06007c81fa99e813cbf4583dab326764ba0ef017. Current head: 4c8093dec7d9366dad4a81fe1a...
Opengraph URL: https://github.com/RustPython/RustPython/pull/9066
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b3b1b665-6fb9-7a4d-e98b-80e5b293ca56 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E636:29AEE8:33D344B:450597A:6B01F91A |
| html-safe-nonce | e74a18ebe7f11e6ff68acc08d3ec1c44ad20c884bd49879b734256c3205da7e2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjM2OjI5QUVFODozM0QzNDRCOjQ1MDU5N0E6NkIwMUY5MUEiLCJ2aXNpdG9yX2lkIjoiODg5ODMwMTU0MTg2MjIwOTgxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 140ec3f8317e1a6bbb025082ddaac6ab97f0e4ec80b49f246cf56c4c049b5ba0 |
| hovercard-subject-tag | pull_request:4811250491 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9066/files |
| twitter:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/336763669?s=400&v=4 |
| og:image:alt | Current Python 3.15 main target #8950 is merged. This PR now targets main and replays only its unique commits onto 06007c81fa99e813cbf4583dab326764ba0ef017. Current head: 4c8093dec7d9366dad4a81fe1a... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width