* Take re pos/endpos as signed integers
Negative values clamp to 0, and values beyond Py_ssize_t raise
OverflowError.
Assisted-by: Claude Code:claude-opus-5-5
* Port the remaining runtime fixes from #7993
- bytearray: keep the buffer exported while converting the needle of
find/count/index/rfind/rindex/__contains__/split/rsplit and the hex
separator, so resizing from there raises BufferError
- str(): report non-str encoding/errors as "str() argument 'X' must be
str, not T", and check argument counts and name/position duplicates
for keyword calls
- _json.scanstring: take end as a signed integer and raise ValueError
when it is out of bounds
- lzma: reject filter specs with keys the filter does not take
- mmap: raise ValueError when growing a shared anonymous mapping on
Linux/NetBSD
- _sqlite3: check that the backup progress argument is callable
- Remove the expectedFailure markers of the tests these fix
Assisted-by: Claude Code:claude-opus-5-5
* Reject arguments given by name and position in FuncArgs::bind_for
bind_for reports a keyword that fills a parameter already given by
position before other binding errors, using the parameter list of the
FromArgs type. getargs shares the message, str() drops its own check,
and blake2b/blake2s name themselves in binding errors.
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: James David Clarke <james@jamesdavidclarke.com>
The digest, HMAC, PBKDF2 and scrypt state moves out of the `_hashlib`
module into a feature-gated `rustpython_common::hashlib` that owns each
state behind a `Mutex` and reports plain Rust results; `_hashlib` and
`_blake2` keep the object glue.
The engine writes its state through a raw pointer into a caller-owned
buffer, so the buffer is boxed and only the pointer travels with the
Python object, and it carries the alignment the engine asserts. The
wrapper is built only after a successful init, so a rejected digest name
leaves nothing to drop over storage the engine never wrote.
blake2 moves from `blake2` to `blake2b_simd` / `blake2s_simd`, whose
`Params` carry the whole parameter block. `_blake2.blake2b` and
`blake2s` become immutable types with `SALT_SIZE`, `PERSON_SIZE`,
`MAX_KEY_SIZE` and `MAX_DIGEST_SIZE` as class attributes, and their
instances are instances of those types. They accept `key`, `salt`,
`person`, `fanout`, `depth`, `leaf_size`, `node_offset`, `node_depth`,
`inner_size` and `last_node`. `_hashlib.scrypt` is published on the
same engine.
Six `test_hashlib` expectedFailure markers drop with it. `blake2`,
`digest`, `dyn-clone`, `hmac` and `pbkdf2` lose their last consumer.
Assisted-by: Grok
Assisted-by: Claude