Commit Graph
660 Commits
Author SHA1 Message Date
Jeongseop LimandJeong YunWon c271e33214 Reject surplus positional arguments before converting any (#9242)
* Count positional arguments before converting any

FuncArgs::bind_for rejected surplus positional arguments only after
FromArgs::from_args had converted every declared parameter. A
conversion can run user code (__iter__ for PyIter, __index__ for
ArgIndex), so filter(None, it, 0), hex(x, 1) and pairwise(it, 0) raised
whatever that code raised instead of the TypeError CPython reports
before it touches any argument.

Check the count against FromArgs::arity() before from_args runs. For
that bound to be safe:

- The default arity() has no upper bound, since a manual impl may take
  positional arguments itself. KwArgs, (), DirFd, OpenDirFd and csv's
  FormatOptions declare the bound they actually have.
- A derived struct adds the upper bound of each flattened field.
- A tuple sums upper bounds with saturating_add.

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

* Note why arity upper bounds saturate

Comment that an unbounded upper bound is usize::MAX, which is why the
tuple and derived arity() sums use saturating_add, and drop the CPython
mention from the positional count check comment.

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

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-24 01:02:44 +09:00
1ndahous3 3b9a9f4a4c Reuse unchanged string results in affix removal and partitioning (#9324)
* Reuse unchanged string results in affix removal and partitioning

Assisted-by: Codex:GPT-6

* Qualify the ASCII macro in the string test

Assisted-by: Codex:GPT-6
2026-10-24 00:59:43 +09:00
1ndahous3 fd3c3fca64 Return the correct bytes reconstruction arguments (#9326)
Assisted-by: Codex:GPT-6
2026-10-23 18:06:06 +09:00
1ndahous3 33b656fae1 Hash iterable elements directly in set predicates (#9325)
Assisted-by: Codex:GPT-6
2026-10-23 18:05:29 +09:00
1ndahous3 bbbde24061 Share repeated itertools.product pools (#9323)
Assisted-by: Codex:GPT-6
2026-10-23 18:03:11 +09:00
1ndahous3 aa3a851966 Release consumed itertools.tee buffers (#9322)
Assisted-by: Codex:GPT-6
2026-10-23 18:01:54 +09:00
youknowdot f482e0c2cf Track Unpickler payload references during cyclic GC (#9288)
Traverse input callbacks, buffer iterators, memo slots and memo proxy owners.
Clear outgoing payload edges through deferred drops and retire successful
reinitialization state outside the state lock. Retain stream and buffers
payload-cycle regressions in the existing pickle snippet.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:17:06 +09:00
1ndahous3 bd85943b62 Default absent CreateProcess startup attributes (#9267)
* Default missing CreateProcess startup attributes

Assisted-by: Codex:GPT-6

* Use a single platform guard for winapi tests

Assisted-by: Codex:GPT-6
2026-10-21 19:57:55 +09:00
1ndahous3 11a6455c61 Fix ctypes assignment conversion and backing-buffer retention (#9251)
* Fix ctypes assignment conversion and backing-buffer retention

Assisted-by: Codex:GPT-6

* Preserve ctypes assignment metadata and pointer-width writes

Assisted-by: Codex:GPT-6

* Enable passing Windows console tests

Assisted-by: Codex:GPT-6
2026-10-21 12:06:39 +09:00
1ndahous3 b0142d0464 Implement socket.recvmsg_into on Unix (#9268)
Assisted-by: Codex:GPT-6
2026-10-21 12:01:27 +09:00
1ndahous3 02f4fbbb62 Use ordinary fileno lookup in select (#9266)
* Use ordinary fileno lookup in select

Assisted-by: Codex:GPT-6

* Share select descriptor conversion

Assisted-by: Codex:GPT-6
2026-10-21 11:59:10 +09:00
1ndahous3 6f2d4a203d Share immutable tokenizer state between iterations (#9265)
Assisted-by: Codex:GPT-6
2026-10-21 11:58:48 +09:00
1ndahous3 ebb6a78521 Preserve reflected multiplication for sequence subclasses (#9228)
Assisted-by: Codex:GPT-6
2026-10-20 22:40:26 +09:00
youknowdot 145749e580 Keep regression collector tracebacks plain in JSON (#9245)
Normalize inherited exception formatting once so structured results and terminal details share uncolored traceback strings, even when colors are forced. Add synthetic ordinary and subtest failure/error coverage without changing existing assertions.

Implementation and focused validation were AI-assisted with OpenAI Codex.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-20 20:06:23 +09:00
Jeongseop Lim d634f2649c Check enumerate() arguments before calling iter() (#9241)
EnumerateArgs bound the iterable as PyIter, so argument binding called
__iter__ before start was converted and before surplus positional
arguments were rejected. An exception from __iter__ then replaced the
TypeError CPython raises for a bad start or a third argument.

Bind the iterable as an object and call get_iter() in py_new, after
start is converted, which is the order of CPython's enum_new_impl.

Assisted-by: Claude Code:claude-opus-5-5
2026-10-20 19:55:56 +09:00
Jeongseop Lim 0c5e5f68ee Use compensated summation in sum() like CPython (#9237)
CPython keeps a Neumaier compensation term while sum() accumulates an
exact float or complex, and reaches that path from an exact int start
too. RustPython added items one by one, so sum([0.1] * 10) returned
0.9999999999999999 instead of 1.0.

Port the int, float and complex fast paths of builtin_sum_impl, each
falling back to plain addition at the first item it does not handle.

Assisted-by: Claude Code:claude-opus-5-5
2026-10-20 19:52:27 +09:00
1ndahous3 980edd8b57 Preserve ctypes element views and their references (#9229)
* Preserve ctypes element views and their references

Assisted-by: Codex:GPT-6

* Fix ctypes reentrant ownership and scalar view handling

Assisted-by: Codex:GPT-6

* Fix ctypes pointer view writes and indexed object lookup

Assisted-by: Codex:GPT-6

* Fix ctypes field byte order and encoded instance copies

Assisted-by: Codex:GPT-6

* Fix ctypes effective field types and overlapping pointer copies

Assisted-by: Codex:GPT-6

* Reject arrays for incomplete ctypes pointer fields

Assisted-by: Codex:GPT-6
2026-10-20 09:37:33 +00:00
youknowdot c3b8ce79c8 Preserve regression collector outcomes and canonical process context (#9234)
* Preserve regression collector outcomes and canonical process context

Record complete test identities, subtest diagnostics and fixture outcomes while keeping unittest event counts separate from once-per-case JSON totals. Reuse canonical process setup and avoid an unnecessary library-path override.

Assisted-by: OpenAI Codex: model version unavailable

* Fix regression runner subtest formatting and qualified discovery

Assisted-by: OpenAI Codex: model version unavailable

* Make runner traceback assertions independent of forced colors

Assisted-by: OpenAI Codex: model version unavailable

* Keep dev VM frames compact for stdlib imports

Carry the established integration VM optimization override into the regression runner split. Retain debug assertions, stack guards and Python recursion limits.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-20 18:07:54 +09:00
1ndahous3 a16dc33b48 Preserve loop stack state for monitored line jumps (#9232)
Assisted-by: Codex:GPT-6
2026-10-20 09:24:27 +09:00
1ndahous3 0d46e8a40f Preserve loop LINE events with INSTRUCTION monitoring (#9231)
Assisted-by: Codex:GPT-6
2026-10-20 09:24:01 +09:00
1ndahous3 915a390725 Release BytesIO and StringIO buffers on close (#9230)
Assisted-by: Codex:GPT-6
2026-10-20 09:23:24 +09:00
1ndahous3andJeong, YunWon eb2ffc61dd Use sequence repetition for ctypes array types (#9185)
Assisted-by: Codex:GPT-6

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-10-19 15:17:53 +00:00
1ndahous3 c434bfdacd Preserve deque subclass construction and iteration in arithmetic (#9207)
* Preserve deque subclass construction and iteration in arithmetic

Assisted-by: Codex:GPT-6

* Handle allocation failures during deque subclass repetition

Assisted-by: Codex:GPT-6
2026-10-19 20:30:05 +09:00
1ndahous3 aa9455082d Support Netlink socket addresses (#9206)
Assisted-by: Codex:GPT-6
2026-10-19 20:28:39 +09:00
1ndahous3 65f30fd151 Return character counts from the UTF-8 encoder fast path (#9205)
Assisted-by: Codex:GPT-6
2026-10-19 20:28:10 +09:00
1ndahous3 3a0ef4d3d4 Allow subclassing the remaining public itertools types (#9204)
Assisted-by: Codex:GPT-6
2026-10-19 20:27:35 +09:00
1ndahous3 257d291b3a Preserve extended opcode arguments under sys.monitoring (#9203)
* Preserve extended opcode arguments under sys.monitoring

Assisted-by: Codex:GPT-6

* Restart monitored execution after line callback jumps

Assisted-by: Codex:GPT-6

* Keep monitoring argument state out of the dispatch loop

Assisted-by: Codex:GPT-6
2026-10-19 20:27:00 +09:00
youknowdot c208352caf Guard regression data runner against multiprocessing re-entry (#9195)
Run discovery and result writing only from the script entrypoint. Spawn and forkserver imports as __mp_main__ must not recursively execute the complete test suite or remove the parent result file.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-19 20:11:55 +09:00
1ndahous3 e7e3dfd6ce Allow reflected fallback for in-place set operators (#9182)
Assisted-by: Codex:gpt-6
2026-10-18 23:00:18 +09:00
1ndahous3andJeong, YunWon e411f91721 Share ctypes array-field storage with its owner (#9186)
* Share ctypes array-field storage with its owner

Assisted-by: Codex:GPT-6

* Clarify ctypes view storage safety requirements

Assisted-by: Codex:GPT-6

* Handle overlapping ctypes field buffer assignments

Assisted-by: Codex:GPT-6

* Track ctypes from_buffer sources for overlapping assignments

Assisted-by: Codex:GPT-6

* Snapshot memoryview sources for borrowed ctypes storage

Assisted-by: Codex:GPT-6

* Retain source buffers until memoryview assignment completes

Assisted-by: Codex:GPT-6

---------

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-10-18 22:39:56 +09:00
1ndahous3 7750dbcb86 Accept keyword arguments in SemLock constructors (#9188)
Assisted-by: Codex:GPT-6
2026-10-18 22:37:01 +09:00
1ndahous3 e792ec8fb3 Accept bytes-like input in pyexpat.Parse (#9187)
Assisted-by: Codex:GPT-6
2026-10-18 22:36:39 +09:00
1ndahous3 94ec89a687 Honor stored ctypes byref addresses (#9184)
Assisted-by: Codex:GPT-6
2026-10-18 22:34:59 +09:00
youknowdotandJeong YunWon 3f55cf4af0 Implement basic REPL execution and fix piped stdin handling (#9163)
* Preserve original main VM through C API execution

Run and finalize the original main VM while keeping the registered attachment template available without holding its mutex across Python callbacks.

Assisted-by: OpenAI Codex:model version unavailable

* Make unraisable reporting robust at hook boundaries

Keep the existing message API and traceback formatting while handling missing, disabled, audited and failing hooks without panicking.

Assisted-by: OpenAI Codex:model version unavailable

* Separate interactive warning collection from compilation

Retain ordinary warning behavior and typed module APIs while exposing record-local parser warnings and post-warning code generation. Add a source-only lazy future-import guard.

Assisted-by: OpenAI Codex:model version unavailable

* Evaluate native stdin with shared VM record semantics

Use one evaluator for basic REPL and root transports, preserve effective inspect snapshots and future flags, and carry owned host exit status through original-main finalization.

Assisted-by: OpenAI Codex:model version unavailable

* Refresh canonical REPL tests and retire fixed failures

Run update_lib migrate from pinned CPython 3.15.0, preserving three remaining platform/runtime markers and retiring the two traceback/startup failures verified on the native evaluator.

Assisted-by: OpenAI Codex:model version unavailable

* Keep the root compiler dependency for development targets

The native evaluator now compiles through the VM. Only root benchmarks and the parse_folder example use rustpython-compiler directly, so declare it as a dev dependency while preserving VM compiler features.

Assisted-by: OpenAI Codex:model version unavailable

* Validate explicit conditional failure marker retirement

Require exact selector and original decorator evidence for each conditional expected-failure marker retired by migrate. Preserve undeclared guards and reject missing, duplicate, modified or unconsumed declarations.

Assisted-by: OpenAI Codex:model version unavailable

* Refresh canonical stdin and exception audit tests

Migrate the pinned CPython 3.15.0 modules and their canonical helper fixtures through update_lib. Retire exactly four failure markers proven obsolete by hosted CI, preserving all other existing guards.

Assisted-by: OpenAI Codex:model version unavailable

* Synchronize runpy warning attribution and document remaining capabilities

Migrate whole canonical runpy.py to pass module names to compile. Use update_lib to annotate only reproduced missing-capability cases: absent _testcapi import-event tests, unsupported startup/import-time features, and the deferred frozen-loader module-attribution caller.

Assisted-by: OpenAI Codex:model version unavailable

* Propagate interrupted native stdin reads to signal dispatch

Preserve the shared input buffer and partial bytes while returning EINTR to the VM before retrying. Exercise the transport deterministically and verify a returning SIGINT handler while pipe stdin stays open.

Assisted-by: OpenAI Codex:model version unavailable

* Reject statements after a compound statement in single mode

single_mode_multiple_statements_error now reports "invalid syntax" at the
statement that follows a compound first statement, and interactive_input
runs it right after parsing as compile() does.

The lazy `from __future__` import check moved from lazy_future_import_error
into unsupported_grammar_error, so it applies to every compile mode.

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

* Remove passing expected failure from test_runpy

test_run_module_filter_syntax_warnings_by_module passes.

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

* Restructure stdin execution after Modules/main.c and pythonrun.c

- src/lib.rs follows pymain_run_python: pymain_run_stdin, pymain_repl,
  pymain_run_startup, pymain_run_interactive_hook and pymain_run_pyrepl
  return exit codes instead of raising SystemExit.
- VirtualMachine gains run_any_stdin (_PyRun_AnyFile),
  run_interactive_loop (_PyRun_InteractiveLoop) and run_simple_stdin;
  run_shell feeds rustyline lines into run_interactive_loop, and
  sys._baserepl calls run_any_stdin.
- print_uncaught_exception (PyErr_Print) replaces
  report_uncaught_exception, and handle_system_exit_and_keyboard_interrupt
  replaces handle_reported_exception.
- An unhandled KeyboardInterrupt is recorded and the process exits
  through SIGINT after finalization.
- Interpreter::run_main replaces run_with_exit_status and InterpreterExit;
  rustpython_capi::run_main_interpreter takes an exit-code callback.
- config_set_inspect audits cpython.PyConfig_Set and rebuilds sys.flags
  through set_flag_obj (_PySys_SetFlagObj); the inspect state is an
  AtomicBool and dict replace_by_identity is removed.
- add_main_module (PyImport_AddModuleRef("__main__")) is used by the
  interactive and simple-file paths.
- The interactive parser warning helpers take their state directly.

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

* Exit through Py_Exit from PyErr_Print and run the basic REPL via stdin

- print_uncaught_exception (PyErr_Print) calls exit_process (Py_Exit) for a
  SystemExit when inspect mode is off, instead of returning the exception.
  run_interactive_loop no longer checks SystemExit itself and flushes after
  printing an error; sys._baserepl returns None.
- exit_process finalizes through VirtualMachine::finalize_ex, which holds
  the Py_FinalizeEx steps split out of Interpreter::finalize, and exits
  through host_env::os::exit_with_cleanup (C exit()).
- The basic REPL on a terminal (PYTHON_BASIC_REPL, or _pyrepl missing)
  runs run_any_stdin instead of the rustyline shell.
- run_shell saves the history after every line.

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

* Display exceptions through PyErr_Display and track the main thread running __main__

- display_exception (PyErr_Display) and display_exception_to (_PyErr_Display)
  try traceback._print_exception_bltin before the native printer and flush
  the file. PyErr_Print's excepthook fallback, print_exception and
  sys.excepthook use them. A missing sys.stderr is reported with
  dump_object (PyObject_Dump); a None sys.stderr prints nothing.
- Paths gains program_name (argv[0]) from getpath. The "can't open file"
  message uses it with strerror(errno) and goes to sys.stderr.
- running_main holds the ident of the thread running __main__.
  pymain_run_python sets it around running the main code, Py_Exit clears it,
  the fork child reinitializes it, and _interpreters.is_running reads it
  instead of treating the main interpreter as always running.
- Interpreter::run_main clears the unhandled KeyboardInterrupt flag before
  running and applies exit_sigint after finalizing; finalize no longer
  does.
- run_interactive_loop returns a SystemExit raised outside inspect mode
  again and no longer flushes after printing an error; run_shell saves the
  history once after the loop.
- pymain_set_inspect reports its error through print_uncaught_exception.

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

* Treat a parse error at the end of the source as incomplete input

A parser error that starts at the end of the source is reported as
_IncompleteInputError when incomplete input is allowed, so the
interactive loop and codeop keep reading after `try:` and its block or
after a decorator line.

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

* Place syntax errors on tokens made up at the end of the input

A parse error on the NEWLINE, DEDENT or ENDMARKER the tokenizer makes up
at the end of the input now carries an EofToken: the number of lines
read and the last line. SyntaxError takes its lineno and text from it,
and its offset is that line's length with end_offset -1, or 0 for both
when the error is raised at the token itself (the generic syntax error
and a missing forced `:` or `(`). Exec input that does not end with a
newline is checked with one appended.

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

* Slice the source with get when checking an indented block error at EOF

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

* Rename the host exits after C exit() and fix wasi and Windows builds

- host_env::os::exit now calls the C exit() on every platform; on Windows
  std::process::exit ends in ExitProcess, so it flushes the Rust stdout
  and calls libc::exit there. The former exit, which calls _exit(), is
  now exit_immediately, used by os._exit, faulthandler and
  posixsubprocess.
- errno::strerror_string is available on wasi.
- PyGlobalState::reinit_running_main is built only where its fork caller
  is.

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

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-18 09:22:12 +00:00
1ndahous3 924e34200f Honor setter-only descriptors in STORE_ATTR specialization (#9181)
Assisted-by: Codex:gpt-6
2026-10-18 11:02:46 +09:00
1ndahous3 e64023020c Fix CSV field limit validation and concurrent updates (#9160)
Assisted-by: Codex:gpt-6
2026-10-18 10:59:51 +09:00
1ndahous3 99bf003f92 Avoid codec registry deadlocks during object cleanup (#9159)
Assisted-by: Codex:gpt-6
2026-10-18 10:59:15 +09:00
1ndahous3 cf3bcee3fd Release SQLite callbacks and expanded trace SQL safely (#9151)
* Release SQLite callbacks and expanded trace SQL safely

Assisted-by: Codex:gpt-6

* Drain SQLite callback cleanup before reinitialization and after blob operations

Assisted-by: Codex:gpt-6

* Drain SQLite cleanup after statement reset

Assisted-by: Codex:gpt-6

* Fix concurrent SQLite connection reinitialization

Assisted-by: Codex:gpt-6

* Restore SQLite factory defaults after callback cleanup

Assisted-by: Codex:gpt-6
2026-10-18 10:58:39 +09:00
youknowdot 51e886c224 Fix optional OpenSSL duplex I/O on Unix (#9173)
* Fix optional OpenSSL duplex I/O on Unix

Release connection locks before readiness waits while serializing native SSL
attempts and preserving owned write retries. Wake waiters on native progress
and socket identity invalidation, and construct callback/native exceptions
after unlocking.

Add regression coverage to the existing SSL snippet and run the optional
OpenSSL backend in the existing Unix CI matrix. Windows and AIX retain the
legacy transport pending a separate compatibility-safe driver.

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate OpenSSL runtime checks into the existing CI step

Keep the minimal system and vendored OpenSSL build checks, and run the
Unix SSL regressions in the existing system OpenSSL step. Preserve the
runtime feature set and enable its macOS dependency in that job.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 23:36:27 +09:00
youknowdot fc9f4a9541 Update importlib to CPython 3.15 with native bootstrap callback (#9169)
* Refresh canonical importlib and preserve native import callback

Cache the original builtin __import__ callback so CPython 3.15 importlib's
hierarchical locking uses the existing native parent-initialization path.
Refresh the complete canonical importlib and related test/helper families
from CPython d220409a13b77de7a6c30abe16ea90db01528edc through update_lib.

Preserve both nondecorator importlib guards in the updater. Add explicit
hash-pinned removal of reviewed obsolete canonical files, with full
preflight, dry-run, idempotence and refusal tests. Preserve empty fixtures.

Assisted-by: OpenAI Codex:model version unavailable

* Complete canonical inspect and types closure for importlib metadata

Refresh whole canonical inspect/types production and related test families
through update_lib after hosted CI exposed stale __cached__ consumers.
Add coroutine and async-generator state getters, with closed-state priority
for reentrant frame-local finalizers, and expose the existing frame-locals
proxy type with its CPython class documentation.

Preserve the optional _datetime and unittest import blocks through a narrow
migration adapter. Retain canonical assertions and existing guards; record
the missing LazyImportType expectation before adding a conditional expected
failure, and capability-skip only the two absent-_testcapi CLI fixtures.

Assisted-by: OpenAI Codex:model version unavailable

* Reject canonical removal junctions and read UTF-8 manifests

Reject junctions alongside symlinks in the existing path-component preflight and revalidation. Decode removal manifests explicitly as UTF-8. Add regressions for whole-batch refusal, revalidation, and Unicode dry-run/apply/idempotence.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 14:40:13 +09:00
youknowdot 19d2fe3af7 Align bytes and bytearray operations with Python 3.15 (#9165)
Correct quote escaping, replacement count keyword binding, signed-minimum hex grouping, and clear storage/export handling. Migrate canonical bytes coverage through fail-closed preservation of the existing RustPython customizations, and retire only two freshly verified formatting guards.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-17 11:33:14 +09:00
youknowdot 1ee9a29062 Preserve explicit AST source positions through compilation (#9138)
* Preserve explicit AST column locations through code generation

Assisted-by: OpenAI Codex:model version unavailable

* Remove obsolete location bindings after span migration

Assisted-by: OpenAI Codex:model version unavailable

* Propagate inconsistent AST span provenance without panicking

Assisted-by: OpenAI Codex:model version unavailable

* Preserve mapped positions when exporting optimized Pass nodes

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate AST location regressions and satisfy strict compiler lints

Assisted-by: OpenAI Codex:model version unavailable

* Consolidate equivalent AST literal location cases

Replace the six-way literal-only optimizer matrix with one optimized-AST round-trip, preserving all assertions. Keep the distinct normalized-range identity, explicit Pass provenance, and synthetic format-spec regressions.

Validation: all four appended location cases passed using the verified final-f6a RustPython binary with unchanged native sources. Ran normal pre-commit hooks; no Cargo build or full cyclic snippet suite.

Assisted-by: OpenAI Codex:model version unavailable

* Reuse Ruff source locations in AST conversion

Replace redundant PySourceLocation, Row, and Column wrappers with the compiler-core re-export of Ruff SourceLocation. Use UTF-8 byte coordinates and retain the empty-source fallback. Share the normalized range conversion while preserving caller validation and signed semantic metadata.

Validation so far: independent source and boundary review, rustfmt, and git diff --check. Runtime validation follows after the shared build target is released.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve the first AST preprocessing location error

Share first-error recording between generated-node allocation and synthetic-pass coordinate overflow. Exercise both real compiler-state failure paths in both orders using one MAX_ID location entry.

Validation: focused compiler-state regression, strict codegen all-target Clippy, unchanged full-source seals, rustfmt, and normal pre-commit hooks. No interpreter runtime or broad suite rerun for this error-only change.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-16 10:13:59 +09:00
1ndahous3 d90aa0781f Preserve direct-base precedence in C3 method resolution (#9154)
Assisted-by: Codex:gpt-6
2026-10-16 10:08:59 +09:00
1ndahous3 fdd38b8193 Avoid copying unchanged bytes results (#9149)
Assisted-by: Codex:gpt-6
2026-10-15 14:31:50 +00:00
1ndahous3 dcad0988e7 Fix Unicode StringIO overwrites and cache character positions (#9150)
Assisted-by: Codex:gpt-6
2026-10-15 14:30:53 +00:00
Chanho Lee e01021b902 Fix module docstring global name resolution (#9095)
* Fix module docstring global name resolution

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

* Move module docstring test into syntax_doc.py

Assisted-by: Claude Code:claude-opus-5-5
2026-10-15 20:46:54 +09:00
Luan Taraschi 8de2cbe732 Fix object.__getstate__ deadlock and panic on __slotnames__ (#8981)
object_getstate_default kept the __slotnames__ list read-locked while it
looked up each slot attribute. A getter or __getattr__ that changed the
list (as in test_descr.test_issue24097) then waited forever for the write
lock. A non-str entry in a cached __slotnames__ hit an unwrap and
panicked.

Take a reference to each name and drop the lock before the lookup, raise
TypeError for a non-str name, let errors other than AttributeError
propagate, and check the list size after each item, as CPython does.

Assisted-by: Claude Code:claude-opus-5-5
2026-10-15 20:45:42 +09:00
youknowdot 16e333bded Align asyncio initialization and future state with Python 3.15 (#9136)
* Align asyncio initialization and future state with Python 3.15

Reject native Future and Task reinitialization, validate task contexts, and restore task registration after failed eager context entry. Generate matching asyncio and concurrent Future sources and tests with update_lib from CPython d220409a13b77de7a6c30abe16ea90db01528edc. Preserve the existing pending-task reinitialization regression.

Assisted-by: OpenAI Codex:model version unavailable

* Remove asyncio snippet duplicating canonical reinitialization coverage

Keep the exact-final Lib tests as the reinitialization coverage instead of adding a new snippet for the same contract. Native and library implementation bytes remain unchanged.

Assisted-by: OpenAI Codex:model version unavailable

* Validate both objects in asyncio awaited-by helpers

Match CPython by ignoring non-native Future/Task waiters in add and discard. Keep the existing native reentrant hashing fixture reachable using Future subclasses and use native instances for its membership checks.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-15 10:02:39 +00:00
youknowdot 8b2f9d8f2a Align percent formatting with Python 3.15 final (#9125)
Parse and convert percent fields in order, preserve callback precedence, and align argument-context errors and keyed conversion restrictions. Keep invalid character-length checks ahead of index conversion and cover bounded callback ordering.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-15 10:28:12 +09:00
youknowdot 2ddba03c39 Support frozen ElementTree attribute mappings (#9124)
* Support frozen ElementTree attribute mappings

Preserve assigned mapping identity while copying constructor attributes, and use checked union ownership through Element operations.

Assisted-by: OpenAI Codex:gpt-6.1-sol

* Sync final ElementTree runtime and companion tests

Import ElementTree.py from CPython d220409a13b77de7a6c30abe16ea90db01528edc through update_lib migrate. Copy six complete canonical tests with update_lib copy-test, preserving all surrounding test markers. This aligns pure-Python and native frozendict diagnostic expectations and covers the runtime import companion changes.

Assisted-by: OpenAI Codex:model version unavailable
2026-10-15 10:27:39 +09:00