Commit Graph
17641 Commits
Author SHA1 Message Date
dependabot[bot] 03c5720692 build(deps-dev): bump shell-quote from 1.10.0 to 1.12.0 in /wasm/demo (#8988)
Bumps [shell-quote](https://github.com/ljharb/shell-quote) from 1.10.0 to 1.12.0.
- [Changelog](https://github.com/ljharb/shell-quote/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/shell-quote/compare/v1.10.0...v1.12.0)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-version: 1.12.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-07 10:44:35 +09:00
dependabot[bot] abdf255335 build(deps-dev): bump source-map-js from 1.2.1 to 1.2.2 in /wasm/demo (#8987)
Bumps [source-map-js](https://github.com/7rulnik/source-map-js) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/7rulnik/source-map-js/releases)
- [Changelog](https://github.com/7rulnik/source-map-js/blob/main/CHANGELOG.md)
- [Commits](https://github.com/7rulnik/source-map-js/compare/v1.2.1...v1.2.2)

---
updated-dependencies:
- dependency-name: source-map-js
  dependency-version: 1.2.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-07 10:44:25 +09:00
dependabot[bot] 1fbb58bf01 build(deps): bump rustls from 0.23.43 to 0.23.45 (#8985)
Bumps [rustls](https://github.com/rustls/rustls) from 0.23.43 to 0.23.45.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.23.43...v/0.23.45)

---
updated-dependencies:
- dependency-name: rustls
  dependency-version: 0.23.45
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-07 10:44:01 +09:00
dependabot[bot] bb1c28852c build(deps-dev): bump proxy-addr from 2.0.7 to 2.0.8 in /wasm/demo (#8984)
Bumps [proxy-addr](https://github.com/jshttp/proxy-addr) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/jshttp/proxy-addr/releases)
- [Changelog](https://github.com/jshttp/proxy-addr/blob/master/HISTORY.md)
- [Commits](https://github.com/jshttp/proxy-addr/compare/v2.0.7...v2.0.8)

---
updated-dependencies:
- dependency-name: proxy-addr
  dependency-version: 2.0.8
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-07 10:43:52 +09:00
dependabot[bot] f2f8f95a80 build(deps): bump bitflags from 2.13.1 to 2.13.2 (#8979)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.13.1 to 2.13.2.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.13.1...2.13.2)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-version: 2.13.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-06 23:30:17 +09:00
dependabot[bot]andfanninpm f14f8bce35 build(deps): bump taiki-e/install-action from 2.87.17 to 2.87.21 (#8976)
* build(deps): bump taiki-e/install-action from 2.87.17 to 2.87.21

Bumps [taiki-e/install-action](https://github.com/taiki-e/install-action) from 2.87.17 to 2.87.21.
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/94c31af3204a9f15ab40b35ad084410b905bbc73...4cef1412cce204788f482e778a0b9187f9626a29)

---
updated-dependencies:
- dependency-name: taiki-e/install-action
  dependency-version: 2.87.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Ignore spurious warning from shellcheck

We do not put the `EXTRA_TEST_ARGS` and `SKIPS` variables in quotes by design.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: fanninpm <27117322+fanninpm@users.noreply.github.com>
2026-10-06 23:29:46 +09:00
dependabot[bot] 3b881b6a08 build(deps): bump which from 8.0.5 to 8.0.6 (#8978)
Bumps [which](https://github.com/harryfei/which-rs) from 8.0.5 to 8.0.6.
- [Release notes](https://github.com/harryfei/which-rs/releases)
- [Changelog](https://github.com/harryfei/which-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/harryfei/which-rs/compare/8.0.5...8.0.6)

---
updated-dependencies:
- dependency-name: which
  dependency-version: 8.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-06 23:29:29 +09:00
dependabot[bot] 64dafe0d56 build(deps): bump thin-vec from 0.2.19 to 0.2.20 (#8980)
Bumps [thin-vec](https://github.com/mozilla/thin-vec) from 0.2.19 to 0.2.20.
- [Changelog](https://github.com/mozilla/thin-vec/blob/main/RELEASES.md)
- [Commits](https://github.com/mozilla/thin-vec/compare/v0.2.19...v0.2.20)

---
updated-dependencies:
- dependency-name: thin-vec
  dependency-version: 0.2.20
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-06 23:29:11 +09:00
dependabot[bot] 3e0e4013e1 build(deps): bump reviewdog/action-actionlint from 1.76.0 to 1.77.0 (#8977)
Bumps [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) from 1.76.0 to 1.77.0.
- [Release notes](https://github.com/reviewdog/action-actionlint/releases)
- [Commits](https://github.com/reviewdog/action-actionlint/compare/320fcdd9c860767cf17fab3b20e22e739d5d02b8...2085657ab2c7f48c58edcc767fba576f63bea76b)

---
updated-dependencies:
- dependency-name: reviewdog/action-actionlint
  dependency-version: 1.77.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-05 17:05:59 +00:00
dependabot[bot] 052549a550 build(deps): bump bstr from 1.13.0 to 1.13.1 (#8973)
Bumps [bstr](https://github.com/BurntSushi/bstr) from 1.13.0 to 1.13.1.
- [Commits](https://github.com/BurntSushi/bstr/compare/1.13.0...1.13.1)

---
updated-dependencies:
- dependency-name: bstr
  dependency-version: 1.13.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-05 16:42:49 +00:00
Seonghun AnandJeong YunWon 3d1c174d17 Match invalid format specifier error messages (#8477)
* Match invalid format specifier error details

Assisted-by: Codex:gpt-5.6-sol

* format: convert FormatSpecError in one helper

InvalidFormatSpecifier needs the spec and the object type. Drop
IntoPyException so that path cannot produce a generic message.

Assisted-by: Grok:4.6

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-05 16:39:46 +00:00
dependabot[bot] 54e119d3c1 build(deps): bump glob from 0.3.3 to 0.3.4 (#8972)
Bumps [glob](https://github.com/rust-lang/glob) from 0.3.3 to 0.3.4.
- [Release notes](https://github.com/rust-lang/glob/releases)
- [Changelog](https://github.com/rust-lang/glob/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/glob/compare/v0.3.3...v0.3.4)

---
updated-dependencies:
- dependency-name: glob
  dependency-version: 0.3.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-05 16:14:56 +00:00
dependabot[bot] 55f7abb2f4 build(deps): bump siphasher from 1.0.3 to 1.0.4 (#8974)
Bumps [siphasher](https://github.com/jedisct1/rust-siphash) from 1.0.3 to 1.0.4.
- [Commits](https://github.com/jedisct1/rust-siphash/compare/1.0.3...1.0.4)

---
updated-dependencies:
- dependency-name: siphasher
  dependency-version: 1.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-05 16:10:10 +00:00
5b5c0c7df7 Give dict a CPython-style message for unhashable keys (#8610)
* Give dict a CPython-style message for unhashable keys

Dict operations (subscription, membership, get/pop/setdefault, ...) now
raise "cannot use 'X' as a dict key (unhashable type: 'X')", matching
CPython 3.14 and mirroring the existing PySetInner wrapping. The key is
only materialized on the error path, so hashable keys pay no extra cost.

Enables Lib/test/test_dict.py::DictTest::test_unhashable_key.

Assisted-by: Claude Opus 4.8 (Anthropic)

* dict: only rewrite hashing failures, not key-comparison errors

wrap_unhashable_error previously rewrote any TypeError from a dict
operation as an unhashable-key error, but those operations also compare
keys on a hash collision, so a TypeError from a colliding key's __eq__
was mislabeled. Disambiguate on the error path by re-hashing the key, so
the successful path still hashes exactly once (keeps the do-not-rehash /
atomic invariants) while comparison errors propagate unchanged.

Adds a colliding-key regression test.

Assisted-by: Claude Opus 4.8 (Anthropic)

* dict: hash unhashable keys once up front and cover every insertion path

Addresses the review feedback (thanks @luantaraschi):

- The message now reaches update(), the constructor and |= as well, not just
  __setitem__: merge_object_with_override and merge_from_seq2 now hash the key
  up front and thread it into contains_known_hash/insert_known_hash.
- Hash the key once instead of re-hashing on the error path. This threads the
  hash through the *_known_hash operations (add dict_inner get_known_hash), so
  a __hash__ that fails only on its first call is still reported instead of
  escaping unwrapped.
- Use the fully-qualified type name (matching CPython's %T).
- Only an exact TypeError is rewritten; a __hash__ raising a TypeError subclass
  now propagates unchanged.

pop() and setdefault() have no *_known_hash entry point on the inner map, so
they hash once up front for the message and then do their own single lookup.

Assisted-by: Claude Opus 4.8

* dict: thread the known hash through setdefault and pop as well

Follow-up on the review: setdefault() and pop() previously hashed the key a
second time (inside the inner map) after hash_or_unhashable already hashed it,
so a stateful __hash__ failing on the second call would skip the dict-specific
message. Add setdefault_known_hash / pop_known_hash to the inner map and thread
the precomputed hash, so every operation now hashes exactly once. Adds a
regression test asserting setdefault/pop call __hash__ only once.

Assisted-by: Claude Opus 4.8

* test: hash the key on a non-empty dict so CPython 3.14 exercises the pop path

`{}.pop(CountingHash())` on an empty dict does not hash the key under
CPython 3.14 (the lookup short-circuits), so `CountingHash.calls == 1` was 0
and the snippet failed its CPython parity run. Use a non-empty dict so the
lookup must hash the key exactly once, on both CPython and RustPython. Also
applied `ruff format` (two blank lines before top-level defs).

Assisted-by: Claude Opus 4.8 (Anthropic)

* dict: drop unused internal pop wrapper

Per review, the vm-taking Dict::pop wrapper was dead code (#[allow(dead_code)],
kept only for API symmetry) with no callers. Remove it and fold its doc into
pop_known_hash.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* dict: rename pop_known_hash to pop

Per review, with the plain pop gone the _known_hash suffix no longer earns
its keep, so drop it. Matches the remaining known-hash helpers that still
pair with a base method.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* dict: fold setdefault wrapper into setdefault, drop unused setdefault_entry

Per review, apply the same pattern as pop: the dead setdefault wrapper only
hashed and delegated, so remove it and rename setdefault_known_hash to
setdefault (callers already thread the hash). Also drop setdefault_entry,
which this PR added but nothing uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* dict: use set_cause and Result from fully_qualified_name

After rebasing onto main, fully_qualified_name returns PyResult
and set___cause__ is a private Python setter.

Assisted-by: Grok:4.6

* dict_inner: take a hash for every key operation

Drop the hashing wrappers and *_known_hash aliases. Callers hash
the key and pass it in.

Assisted-by: Grok:4.6

* snippets: add blank line before BadEq class

ruff format requires two blank lines before a top-level class.

Assisted-by: Grok:4.6

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-06 00:24:42 +09:00
Hanjeong Lee 3126762358 Give os.chmod a valid __text_signature__ and keyword arguments (#8968)
* Order chmod's arguments the way CPython declares them

posix.chmod took dir_fd between path and mode. Since #8807 renders
each argument's parameter kind, that put `/` after `*`, which inspect
cannot parse, and path and mode stayed positional-only, so
os.chmod(path=..., mode=...) raised TypeError.

A ChmodArgs struct follows CPython's order, as nt.chmod already does.
path and mode are positional-or-keyword. follow_symlinks shows
CPython's text through py_default, like LinkArgs.

Assisted-by: Claude Code:claude-opus-5

* Reject a text signature that puts `/` after `*` or `**`

The writer counts positional-only parameters up front and emits `/`
when they run out, which assumes they come first in the Rust argument
list. Nothing enforced that, and posix.chmod violated it. The
signature is composed in a const context, so the assert fails the
build and names the fix.

Assisted-by: Claude Code:claude-opus-5
2026-10-06 00:13:55 +09:00
dependabot[bot] 52581b16f1 build(deps): bump https://github.com/astral-sh/ruff-pre-commit (#8970)
Bumps [https://github.com/astral-sh/ruff-pre-commit](https://github.com/astral-sh/ruff-pre-commit) from v0.16.8 to 0.16.9.
- [Release notes](https://github.com/astral-sh/ruff-pre-commit/releases)
- [Commits](https://github.com/astral-sh/ruff-pre-commit/compare/v0.16.8...v0.16.9)

---
updated-dependencies:
- dependency-name: https://github.com/astral-sh/ruff-pre-commit
  dependency-version: 0.16.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-06 00:12:58 +09:00
dependabot[bot] 524f1a2f4c build(deps): bump github/gh-aw/actions/setup from 0.89.17 to 0.89.21 (#8975)
Bumps [github/gh-aw/actions/setup](https://github.com/github/gh-aw) from 0.89.17 to 0.89.21.
- [Release notes](https://github.com/github/gh-aw/releases)
- [Changelog](https://github.com/github/gh-aw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/gh-aw/compare/00457477720387bcc7d7baaf841dedb22ad06617...c35393777e5604a63721d09512263b1383301d4f)

---
updated-dependencies:
- dependency-name: github/gh-aw/actions/setup
  dependency-version: 0.89.21
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-05 23:01:07 +09:00
dependabot[bot] 8cf8917f85 build(deps): bump https://github.com/rbubley/mirrors-prettier (#8969)
Bumps [https://github.com/rbubley/mirrors-prettier](https://github.com/rbubley/mirrors-prettier) from v3.9.8 to 3.9.9.
- [Commits](https://github.com/rbubley/mirrors-prettier/compare/v3.9.8...v3.9.9)

---
updated-dependencies:
- dependency-name: https://github.com/rbubley/mirrors-prettier
  dependency-version: 3.9.9
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-05 22:59:36 +09:00
youknowdot d3ff1eb5ea Keep module cache entries present during import reordering (#8948)
* Reorder the module cache atomically during imports

Add a private exact-dict move primitive and importlib dispatcher so shutdown-order updates never temporarily remove a module. Preserve current values and custom-mapping fallback behavior; validate reentrant equality probe witnesses, invalidate layout caches, and compact moved entries.

Cover all four existing bootstrap reorder sites, including legacy-loader cleanup. Add deterministic trace-window, loader replacement/removal, reentrancy, cache, iterator and compaction regressions. The private native primitive uses true-move semantics; it does not promise arbitrary pop/set callback equivalence.

Assisted-by: Codex:model-version-unavailable

* Keep atomic import regression compatible with modern bootstrap

Run legacy-loader cases when the bootstrap exposes that helper, preserving all four 3.14 paths and the two remaining 3.15 paths. Always retain modern load and exec regressions.

Assisted-by: Codex:model-version-unavailable

* Keep the copied bootstrap unchanged in the native relocation PR

Restore the exact CPython 3.14 bootstrap and retain only the private exact-dict relocation primitive and its direct native regressions. Remove the PR-added callback integration tests while preserving native helper assertions. This prepares a primitive only; imports do not call it and the import race remains unresolved.

Assisted-by: Codex:model-version-unavailable
2026-10-05 20:48:57 +09:00
8e581e6cd5 Truncate sequence index TypeError names to 200 characters (#8967)
* Match CPython's str subscript TypeError message

`str.__getitem__` with a non-index key raised the shared sequence
wording ("str indices must be integers or slices or classes that
override __index__ operator, not 'x'") instead of CPython's
str-specific "string indices must be integers, not 'x'" (bpo-44110 /
gh-88276, Python 3.11).

Add `SequenceIndex::try_from_borrowed_object_with_err`, which takes a
caller-supplied error closure, and have the existing
`try_from_borrowed_object` delegate to it with the unchanged shared
message. `str._getitem` now supplies the CPython-accurate message,
which flows through both `__getitem__` and the mapping subscript slot.
Other sequence types keep the shared wording.

Removes the expectedFailure marker on
`string_tests.StringLikeTest.test_subscript`, fixing it for both
test_str and test_userstring.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Fold str's subscript TypeError into the shared index helper

The previous commit added `SequenceIndex::try_from_borrowed_object_with_err`
(a closure-taking function) so `str` could raise CPython's
"string indices must be integers, not ..." message. Per review, a whole
helper API plus a thin wrapper was overkill for a single caller.

Instead, inline that one error case into `try_from_borrowed_object`: when
`type_name` is "str", raise the str-specific message; every other type keeps
the shared sequence wording. `str._getitem` goes back to the plain `match`
over `SequenceIndex` with no duplicated index parsing. A bad slice key
(e.g. `'a'[::'x']`) still surfaces the slice-specific error, since only the
non-index/non-slice branch is customized.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Truncate index TypeError type names to 200 characters

Route str's non-index TypeError through a function pointer
message helper. Sequence index errors use the same 200-character
type-name cap.

Assisted-by: Grok:4.6

* Encode sequence index TypeError names as type params

`&'static str` cannot be a const generic. SequenceIndexName
holds the name as an associated constant, matching ArgName.
Both str and sequence errors go through one fn(&str) -> String
and a cold TypeError helper.

Assisted-by: Grok:4.6

---------

Co-authored-by: Jaedeok Kim <rn.6d17s2@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-05 18:52:52 +09:00
youknowdot 04d9990616 Add the eager-runtime hook required by Python 3.15 importlib (#8946)
* Add the eager-runtime importlib lazy-attribute hook

Expose _imp._set_lazy_attributes(modobj, name, /), used by CPython 3.15 importlib after eager loading. Match its empty pending-lazy-module registry behavior, including name type and string-subclass hashing checks. This does not implement lazy imports or change the target version or bundled libraries.

Assisted-by: Codex:model-version-unavailable

* Consolidate lazy import hook tests into stdlib_imp

Move the distinct direct-hook argument and hashing contracts into the existing _imp snippet and remove the separate file. Preserve every pre-existing assertion and the CPython version guard; canonical 3.15 lazy-import tests already cover feature-level registry and reification behavior.

Assisted-by: Codex:model-version-unavailable
2026-10-05 08:29:00 +00:00
youknowdot f1ebf16ce0 Implement the sentinel builtin (PEP 661) (#8945)
* Implement the sentinel builtin from PEP 661

Add unique sentinel values with copy/pickle identity, caller module capture, union support, and cycle collection. Compare constructor behavior and six upstream tests with CPython v3.15.0rc2; retain the existing Python target and bundled libraries.

Assisted-by: Codex:model-version-unavailable

* Remove duplicate sentinel snippet tests

Rely on the canonical Lib/test/test_builtin.py sentinel cases when the standard library is updated, as requested in PR #8945 review. Remove the custom snippet without changing the runtime implementation or existing standard-library tests.

Assisted-by: Codex:model-version-unavailable
2026-10-05 16:20:37 +09:00
youknowdot f46ba48f10 Preserve callable addresses in ctypes function pointer casts (#8965)
Read the stored executable address when casting a function pointer and accept function pointer types as cast destinations. The existing ownership dictionary retains the original callback through a cast roundtrip.

Extracted independently on the unchanged Python 3.14 target, without typed callback argument or broader py_object transport changes. One unique callback-address/ownership regression extends the existing ctypes snippet; canonical coverage was checked for duplicates.

Assisted-by: Codex:model-version-unavailable
2026-10-05 15:23:22 +09:00
1ndahous3 e5f332fda4 Release interpreter channel payloads outside internal locks (#8964)
Assisted-by: Codex:gpt-6
2026-10-05 09:43:04 +09:00
youknowdot 5a61850e32 Use populated entries for unpickler MEMOIZE indexes (#8959)
* Use populated entries for unpickler MEMOIZE indexes

A sparse BINPUT followed by MEMOIZE must use the number of occupied memo
entries, not the largest index plus one. Store populated entries in a map,
preserve ascending memo copies, reserve fallibly, and release displaced
references after memo guards end.

Keep existing memo assignment/proxy behavior and add one bounded regression
for sparse BINPUT, MEMOIZE identity and copy order. No protocol version,
GC traversal or unrelated pickle input changes are included.

Extracted from the Python 3.15 migration onto the unchanged 3.14 target.

Assisted-by: Codex:model-version-unavailable

* Move sparse memo regression to standard pickle snippet

Use the module-level snippet name requested in review without changing the regression assertions.

Assisted-by: Codex:model-version-unavailable
2026-10-05 09:03:52 +09:00
youknowdot 6903fed201 Fix disabled stream identity and annotation operand checks (#8960)
Return the context's canonical None singleton when standard streams are
disabled. Check the exact set type before accessing user-rebindable
conditional-annotation tracking objects.

Both fixes apply to the unchanged Python 3.14 target. Include the no-stdio
embedding regression and the unchanged canonical regression from CPython's
3.14 maintenance backport c21e7c45, after the vulnerable 3.14.7 tag.

Extracted from the larger 3.15 migration; no marshal or version changes.

Assisted-by: Codex:model-version-unavailable
2026-10-05 09:03:18 +09:00
Chanho Lee 7536730ed6 Fix store subscr list finalizer deadlock (#8956)
* Release replaced list item outside the lock in STORE_SUBSCR_LIST_INT

Assisted-by: Claude Code:claude-opus-5-5

* Add a snippet for finalizers reading a list during a specialized store

Assisted-by: Claude Code:claude-opus-5-5
2026-10-04 22:47:45 +09:00
Kwak Byoung Min f39b054b9c Match CPython quotechar escaping when doublequote is disabled (#8953)
Let quote-only fields use the existing unquoted escaping path and enable
the existing CPython regression test.

Tested: test_csv, CSV snippet, 240 CPython comparisons, workspace and C-API tests, Clippy, prek
Assisted-by: Codex:gpt-6.1-sol
2026-10-04 13:53:35 +09:00
Bas Schoenmaeckers 5b3e2a40e2 Add recursion guard to the c-api (#8796)
* Add recursion guard to the c-api

* Do not change with_recursion as this has side effects
2026-10-04 13:52:36 +09:00
Bas Schoenmaeckers ada43c4f82 Add PyABIInfo_Check to the c-api (#8941) 2026-10-02 09:59:04 +00:00
Jeong, YunWon c8d63e848e Materialize code constants through the VM (#8867)
PyObjBag built code object constants from a Context alone, and its
frozenset arm was unimplemented!(), so ctx.new_code() panicked on code
containing a frozenset constant such as `x in {1, 2, 3}`.

IntoCodeObject now takes a VirtualMachine and uses PyVmBag for bytecode
and frozen code objects. Context::new_code, PyObjBag and
AsBag for &Context are removed; callers use VirtualMachine::new_code.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Grok:grok-4.7
2026-10-02 17:24:46 +09:00
dependabot[bot] d88c344847 build(deps): bump rand (#8886)
Bumps the random group with 1 update in the / directory: [rand](https://github.com/rust-random/rand).


Updates `rand` from 0.10.2 to 0.10.3
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.10.2...0.10.3)

---
updated-dependencies:
- dependency-name: rand
  dependency-version: 0.10.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: random
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-02 13:05:23 +09:00
Bas Schoenmaeckers d81b7c2cb1 Add basic c-variadic functions to the c-api (#8933)
* Add basic c-variadic functions to the c-api

* Review
2026-10-02 12:25:49 +09:00
Jeong, YunWon 1f83b1593f Fix CI failures and bump version to 0.6.1 (#8940)
* Use AtomicPyTypeFlags in PyType_FromSlots

PyType_FromSlots still imported the old PyAtomicTypeFlags name.

Assisted-by: Grok:4.7

* Pass CPython test args as a bash array

Assisted-by: Grok:4.7

* Bump workspace version to 0.6.1

Assisted-by: Grok:4.7

* Restore the CPython test step in ci.yaml

Assisted-by: Grok:4.7
2026-10-02 11:23:13 +09:00
Jeong YunWon e1dba29fb2 Revert "Drop parking_lot_core git patch and tkinter deps"
Tag 0.6.0 keeps that removal. This restores the parking_lot_core
git patch and the tkinter dependencies on main.

Assisted-by: Grok:4.7
2026-10-02 10:16:03 +09:00
Alessio Attilio ce3f671e10 feat(capi): implement PyModule_Add* and module helpers from modsupport.h (#8927)
Assisted-by: Gemini:gemini-3.7-flash
2026-10-02 09:43:34 +09:00
Bas Schoenmaeckers b3c84c0fc7 Add first draft of PyType_FromSlots (#8918) 2026-10-02 09:40:27 +09:00
Jeong YunWon b2626c56de Drop parking_lot_core git patch and tkinter deps
Comment out the parking_lot_core git patch and use the crates.io
crate. Remove tcl-sys, tk-sys, and the tkinter feature.

Assisted-by: Grok:4.7
0.6.0
2026-10-02 09:39:34 +09:00
Alessio Attilio be3d12e96c implement _imp.create_dynamic and _imp.exec_dynamic (#8919)
Assisted-by: Gemini:gemini-3.7-flash
2026-10-02 09:25:33 +09:00
Jeong, YunWon 1d7d704414 Use bitflagset for type flags (#8873)
* Use bitflagset for type flags

PyTypeFlags is defined with bitflagset! and the atomic tp_flags word with
atomic_bitflagset!, replacing the hand-written PyAtomicTypeFlags.

Assisted-by: Grok:4.7
Assisted-by: Claude:claude-opus-5-5

* Use bitflagset 0.0.4 from its git main branch

bitflagset 0.0.4 is not on crates.io yet. Patch it to the git main
branch in the workspace and in the example projects that depend on
rustpython-vm, since each of them is a separate workspace.

Assisted-by: Claude:claude-opus-5-5

* Depend on crates.io bitflagset 0.0.4

bitflagset 0.0.4 is published. Drop the git patches from the workspace
and the separate example-project workspaces.

Assisted-by: Grok:4.7

* Keep empty patch tables in example workspaces

The example workspaces already have an empty [patch.crates-io] table.
Dropping the bitflagset git line leaves that table in place.

Assisted-by: Grok:4.7

* Call bitflagset methods directly for type flags

Drop the plain-set has_feature wrapper and the intersects,
is_created_with_flags, DEFAULT, and heap_type_flags aliases.
Single-bit updates use insert, and flag combinations use from_slice.

Assisted-by: Grok:4.7

* OR paired type flags in one update

HAS_WEAKREF with MANAGED_WEAKREF, and HAS_DICT with MANAGED_DICT
(and INLINE_VALUES when present), are applied with one |=.

Assisted-by: Grok:4.7

* Store heap type flag sets as constants

HEAPTYPE | BASETYPE, and the dict and immutable variants built from
it, are const values instead of from_slice calls at each use.

Assisted-by: Grok:4.7

* Test SEQUENCE and MAPPING in one load

PyTypeFlags::COLLECTION is the two-bit mask. Callers check it with
one is_disjoint instead of two contains loads.

Assisted-by: Grok:4.7

* Fix clippy 1.99 lints in the vm

Pass closure arguments by value where clippy reports a needless
borrow, drop the unfulfilled redundant_else expectation on sum, and
return the HRESULT after todo!().

Assisted-by: Grok:4.7
2026-10-02 09:20:57 +09:00
1ndahous3 112b7efa80 Promote retained GC objects and batch generation updates (#8930)
Assisted-by: Codex:GPT-6
2026-10-02 01:42:09 +09:00
Bas Schoenmaeckers 468c40d578 Fix clippy errors for latest rust stable (#8934) 2026-10-02 01:40:54 +09:00
Jeong, YunWon cb0f3b012b Add a native _zoneinfo module (#8915)
* Add a native _zoneinfo module

ZoneInfo reads TZif tuples from zoneinfo._common.load_data. The stdlib
module implements utcoffset, dst, tzname, fromutc, and the zone cache.
whats_left compares that class. Cache tests no longer expect failure.

Assisted-by: Grok:grok-4.7

* Fix ZoneInfo layout and keep its cache on the module

utcoffset, dst, and tzname take the object. Zone data is boxed so the
payload lines up with tzinfo on 32-bit. The strong, weak, and timedelta
caches live on each interpreter's _zoneinfo module.

Assisted-by: Grok:grok-4.7
2026-10-01 11:32:32 +09:00
Joshua Megnauth ab3d759e74 CI: Run clippy on more features (#8916)
Clippy doesn't run on everything which is why I keep accidentally
uncovering new lints to fix. I updated CI to run clippy on all features,
except tk, as well as all binaries, examples, and tests. That should
cover everything.

Tk currently doesn't build (at least for me), so that feature is still
disabled in CI.

While here, fix some of the lints that are now raised.
2026-10-01 00:59:00 +00:00
dependabot[bot] 68dbf4f4c4 build(deps-dev): bump webpack-dev-middleware in /wasm/demo (#8914)
Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 7.4.2 to 7.4.6.
- [Release notes](https://github.com/webpack/webpack-dev-middleware/releases)
- [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v7.4.6/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v7.4.2...v7.4.6)

---
updated-dependencies:
- dependency-name: webpack-dev-middleware
  dependency-version: 7.4.6
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 09:51:35 +09:00
dependabot[bot] 7d2b041d33 build(deps-dev): bump brace-expansion in /wasm/demo (#8913)
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) from 1.1.18 to 1.1.21.
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.18...v1.1.21)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 1.1.21
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-01 09:51:27 +09:00
1ndahous3 5b578797e7 Link libffi only when the vm's host_env feature is on (#8912)
Assisted-by: Claude Code:claude-opus-5-5
2026-09-30 13:30:03 +00:00
Joshua Megnauth 3e2d4129fe sqlite: Handle C strs at FFI margins, fix lint (#8910)
Some of the FFI wrappers take in a byte slice that's presumed to be NUL
capped. It's more ergonomic and safer to take in a &CStr which is
impossible to get wrong because it's validated at the margins.

Additionally, there were a few areas where a NUL was embedded directly
into the source (i.e. "COMMIT(NUL)" which displayed as "COMMIT^@"). This
had the interesting effect of breaking grep on the source code.
2026-09-30 22:18:36 +09:00
Jean-Marc Le Roux 3805038dec zlib: clear unconsumed_tail when a bounded decompress reaches stream end (#8908)
* zlib: clear unconsumed_tail when a bounded decompress reaches stream end

When a max_length-bounded Decompress.decompress() call reached the end
of the stream, the bytes after the stream went to unused_data, but
unconsumed_tail kept the previous call's tail, including input the call
had already consumed. A later flush() then moved those stale bytes into
unused_data.

Empty unconsumed_tail at end of stream, as CPython's
save_unconsumed_input() does since gh-158169. CPython releases before
that change report the bytes after the stream in unconsumed_tail, so
the snippet accepts either value when it runs under CPython.

Fixes #8906

Assisted-by: Claude Code:claude-opus-5-5

* zlib: bind the unconsumed input with an if expression

Choose between the empty slice and the rest of the input in one
expression instead of reassigning a mutable binding.

Assisted-by: Claude Code:claude-opus-5-5

* zlib: accept both valid tails in the snippet on every implementation

The snippet no longer branches on sys.implementation. RustPython and
CPython after gh-158169 give an empty tail; CPython before it gives the
bytes after the stream. The stale tail of gh-8906 fails either way.

Assisted-by: Claude Code:claude-opus-5-5
2026-09-30 22:15:40 +09:00
1ndahous3 e8919b9632 Preserve list mutation progress and release removed items outside locks (#8894)
* Preserve list mutation progress and release removed items outside locks

Assisted-by: Codex:GPT-6

* Trim excessive list extension reservations

Assisted-by: Codex:GPT-6
2026-09-30 22:14:47 +09:00