Commit Graph
1143 Commits
Author SHA1 Message Date
youknowdot 9bd84b2f13 Handle full-width operands in the None-return scanner (#9347)
Use decoded logical instructions rather than the preceding raw operand byte. Check referenced constants by None identity and decode common constants without panicking.

Assisted-by: OpenAI Codex:model unavailable
2026-10-25 15:12:50 +09:00
1ndahous3 db4878080a Collect cycles through sets, frozensets and set iterators (#9343)
Assisted-by: Codex:GPT-6
2026-10-25 15:10:43 +09:00
youknowdot 5a0ded80dc Preserve symtable warning exceptions and original filenames (#9282)
Keep warning-hook exceptions untouched instead of rewriting SyntaxError
subclasses. Thread the original Python filename through parser warning
emission and fresh warning-as-error SyntaxError construction, preserving
fsdecoded bytes paths and lone surrogates.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 14:36:59 +09:00
youknowdotandCodex 413710c107 Complete PyTime conversion fixtures and repair existing helpers (#9317)
* Fix rounding and bounds in existing PyTime test helpers

Extract the already-exposed conversion helper prerequisite from the broader #9143 surface without adding new test C-API exports or changing time.sleep.

Assisted-by: Codex:unknown

* Complete PyTime conversion fixtures in _testinternalcapi

Stack the eight consumed conversion APIs on the existing-helper prerequisite in #9317. Keep the arithmetic local to the real fixture consumers; do not expose _testcapi or change sleep/lifecycle behavior.

Assisted-by: Codex:unknown

---------

Co-authored-by: Codex <codex@openai.com>
2026-10-24 11:29:06 +09:00
youknowdot a788de29da Fix interpolated string warning diagnostic locations (#9314)
* Use closing-token locations for interpolated body warnings

Track CPython string-parser fragment anchors separately from escape source offsets. Preserve scoped error-line text and mode-specific final newlines with lazy sparse location indexing.

Assisted-by: OpenAI Codex:model-version-unavailable

* Fix lint checks for interpolated warning diagnostics

Assisted-by: OpenAI Codex (model version unavailable)

* Match CPython interpolated warning phases and fragment diagnostics

Reconstruct body and format-spec decoder fragments, preserve tokenizer/parser action order and pending Single/type-comment errors, and match Unicode protection plus scoped numeric and ordinary-token diagnostics.

Assisted-by: OpenAI Codex:model-version-unavailable

* Use physical final-line locations for ordinary exec warnings

Keep warning and error coordinates consistent across bare CR, CRLF, and LF while retaining file-input synthetic newlines.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 11:28:44 +09:00
youknowdot 1cd1b5d09f Preserve tokenizer-only compiler warning order (#9316)
Use the collected lexical warning order for valid Exec/Eval inputs without parser-origin escape events. Keep tokenizer errors terminal and retain mixed-origin, invalid-source, and Single fallback behavior.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 08:11:22 +09:00
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
youknowdot 0dc77faaab Fix busy interpreter test readiness race (#9328)
Publish readiness only after the main interpreter has completed its first operation, and bound the detached subinterpreter readiness wait. Preserve the original progress assertions, main deadline, and safepoint.

AI assistance covered diagnosis, source changes, review, and focused validation.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-24 01:00:20 +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
Bas Schoenmaeckers 5dcef1aa6d Add subclass type flags (#9327) 2026-10-23 09:38:01 +00: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
youknowdotandyouknowdot c70e9b8443 Sync selected Python 3.15 core library tests and repr type errors (#9321)
* Sync Python 3.15 core library tests and repr type errors

Synchronize ten selected library paths from CPython 3.15.0 at
d220409a13b77de7a6c30abe16ea90db01528edc using the canonical updater,
retaining existing RustPython adapters and failure markers.

Match generic __repr__ invalid-result errors to the qualified type-name
format required by the canonical ExceptionGroup regression, preserving
string results and exceptions raised by the implementation.

Implementation, source review, and validation were AI-assisted. The model
version identifier is unavailable; automated checks are not human
verification. Bounded validation covers 43 passes and one canonical skip,
not the full repository suites.

Assisted-by: OpenAI Codex:model version unavailable

* Preserve original escape decoder consumed length after callbacks

Keep the original input length as consumed after successful unicode-escape
and raw-unicode-escape decoding, including error-handler input replacement.
Only report the current cursor when a non-final decode stops on incomplete
input, matching CPython's codec wrappers and incomplete exits.

Fix the canonical Unicode escape mutation regression that failed CI on
Linux, macOS and Windows. Preserve all Lib tests and existing assertions.
Bounded Linux validation: 55 passes and one canonical skip, CLI build and
strict common/VM Clippy passed. Full repository suites were not run.

Implementation, source review, and validation were AI-assisted. The model
version identifier is unavailable; automated checks are not human
verification.

Assisted-by: OpenAI Codex:model version unavailable

---------

Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-23 18:01:14 +09:00
youknowdotandyouknowdot afe5d9030a Separate constructor and instance vectorcall dispatch (#9320)
Keep constructor fast paths separate from per-instance vectorcall support.
Track automatic eligibility without discarding raw support required by
PyVectorcall_Call, and recheck eligibility in retained callable wrappers.

Implementation and source review were AI-assisted. The model version
identifier is unavailable; automated checks are not human verification.

Assisted-by: OpenAI Codex:model version unavailable

Co-authored-by: youknowdot <336763669+youknowdot@users.noreply.github.com>
2026-10-23 17:59:19 +09:00
youknowdot 73b6806608 Limit single-input parser warning emission to the first logical input (#9304)
Keep later numeric warnings available after parser warning escalation. Preserve compound tokenizer warning emission and legacy malformed-source fallback.

Assisted-by: OpenAI Codex:gpt-6-astra
2026-10-23 17:54:12 +09:00
youknowdot 94f92e4ab8 Use final numeric character for warning error offsets (#9305)
Assisted-by: OpenAI: GPT-6.1
2026-10-22 23:24:53 +09:00
youknowdot 36f8e8937a Recover numeric warning errors in AST single mode (#9303)
Match ordinary single compilation by allowing later numeric warnings raised as errors to take precedence after a parser-origin escape warning. Preserve tokenizer-origin guards and the separate prompt path.

Assisted-by: Codex:unknown
2026-10-22 23:23:49 +09:00
youknowdot 6c171fffe1 Align mapping collection and call unpacking with Python 3.15 (#9302)
* Align mapping collection and call unpacking with Python 3.15

Preserve iterator exceptions and exact-list results when collecting mapping
methods, defer callable formatting, and retain exact-dict stored hashes.
Synchronize complete test_extcall with CPython v3.15.0.

Assisted-by: Codex:unknown

* Update pickle and pickletools libraries for Python 3.15

Synchronize the six coherent serialization modules with CPython v3.15.0
through update_lib, retaining existing RustPython adaptations.

Assisted-by: Codex:unknown
2026-10-22 23:23:15 +09:00
youknowdotandCodex 0b0a360764 Use __main__ when compiling filesystem scripts (#9301)
Forward script compiler warnings through the typed module-aware entry point. Sync canonical command-line script coverage from CPython d220409a13b77de7a6c30abe16ea90db01528edc with the existing RustPython marker preserved.

Assisted-by: OpenAI Codex:model-version-unavailable

Co-authored-by: Codex <codex@openai.com>
2026-10-22 12:02:16 +00:00
youknowdot eb03691084 Order parser warnings for valid source while preserving recovery boundaries (#9296)
Reuse the parser warning collector only for valid, recovery-eligible source. Preserve malformed-source and tokenizer-origin interpolation fallback.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:46:20 +00:00
SeungJe Jeong e57c8db83a Allow same-size bytearray.resize with exported buffers (#9217)
* Allow same-size bytearray.resize with exported buffers

Use the existing export snapshot or exclusive payload access to allow
same-size requests without a recursive read lock in codec callbacks.
Continue rejecting exported length changes and preserve zero filling.

Enable the CPython regression and consolidate resize coverage in the
existing bytearray snippet, including a bounded concurrent callback test.

Assisted-by: Codex:GPT-6

* remove redundant tests
2026-10-22 19:37:21 +09:00
youknowdot 1ba1107115 Align ctypes call ownership and C error state with Python 3.15 (#9218)
* Align ctypes call ownership and C error state with Python 3.15

Keep native raised errors separate from handled exceptions and preserve them across teardown callbacks. Import the related canonical ctypes call and type contracts.

Assisted-by: OpenAI Codex: model version unavailable

* Enumerate ctypes shared libraries natively on Linux and Android

Copy loader-owned names before Python filesystem decoding and update the related canonical ctypes utility and discovery tests from CPython 3.15. Preserve existing platform paths and dllist test markers.

Assisted-by: OpenAI Codex: model version unavailable

* Enable canonical dllist system enumeration coverage on Linux

Regenerate the pinned test through update_lib patches with reviewed marker data. Preserve other platform conditions and the unavailable extension-fixture guard.

Assisted-by: OpenAI Codex: model version unavailable

* Match Python float and long-double C argument representations

Use the existing Python float formatter for float and double C argument representations. Keep long-double arguments on the canonical generic-address representation path. Preserve the unchanged canonical parameter repr assertions.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-22 18:16:22 +09:00
youknowdot 580706fa19 Fix _interpreters shared and updates argument diagnostics (#9295)
Use parameter names in dictionary validation errors to match Python 3.15.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 18:11:58 +09:00
youknowdot e102ccdae1 Use globals module names for eval and exec warnings (#9294)
* Use globals module names for eval and exec warnings

Forward the supplied scope module through compilation warnings while
preserving typed compile entrypoints and missing-name filename fallback.

* Retire the resolved exec warning-filter expected failure

Regenerate test_builtin through update_lib with all other adaptations
preserved after hosted CI reports the canonical method succeeds.
2026-10-22 18:10:44 +09:00
youknowdot 308085dafc Preserve float-subclass values in time.sleep conversion (#9292)
Follow CPython PyFloat_AsDouble without calling float-subclass overrides.
Keep index precedence and other conversion behavior unchanged.

Assisted-by: OpenAI Codex
2026-10-22 14:50:34 +09:00
youknowdot 39bee673a9 Respect static-method binding in builtin __self__ (#9291)
Reuse get_self() so static builtin methods expose None rather than their
stored class receiver, while preserving bound and module receivers.
2026-10-22 14:08:03 +09:00
youknowdot 49f4771e91 Reuse shared awaitable validation for defaulted anext (#9290)
Match CPython 3.15 await-result diagnostics and reject coroutine results
from custom __await__ consistently with the nondefaulted path. Preserve
native-coroutine unwrapping and wrapper state handling.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 13:42:26 +09:00
youknowdot 43368209c5 Support signed numeric constants in match pattern ASTs (#9279)
Recognize numeric Expr::Constant values when validating signed literal
patterns, alongside parser-produced NumberLiteral nodes. Python AST
conversion uses the former representation. Accept unary plus as well as
minus and fold signed real/imaginary and complex patterns consistently.

Boolean and non-numeric constants remain excluded. Preserve the existing
parser-produced literal path and do not change source grammar.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 11:21:10 +09:00
Jeong, YunWonandyouknowdot aba1f5cf69 Align AST construction and replacement with Python 3.15 (#9272)
Validate missing-field metadata, recognize exact generic aliases for list
field defaults, and preserve surrogate names in ordered constructor errors.
Route generated AST replacement methods through the shared argument handler.

Extract the native closure from the 3.15 integration without parser/schema
changes or new library copies. Existing canonical tests remain unchanged.

Assisted-by: OpenAI Codex:model-version-unavailable

Co-authored-by: youknowdot <dot@youknowone.org>
2026-10-22 11:18:52 +09:00
Jeong, YunWonandyouknowdot f0b1e82652 Add tracing profiler and Python 3.15 offline profiling tools (#9271)
* Add deterministic profiler and canonical Python 3.15 tools

Use the merged operation critical sections with interpreter-bound profiler
entry checks and short payload borrows. Trace owned code references for GC.
Import the canonical tracing and offline profiling output closure via the
repository updater, retaining existing test markers.

Assisted-by: dot:GPT-6.1

* Clarify standalone profiling license cross-reference

Preserve license terms and copyright notices; point to the reproduced
Apache text below instead of CPython's original OpenSSL section above.

Assisted-by: dot:GPT-6.1

* Defer unsupported sampling package from profiler extraction

Keep the deterministic tracing profiler and its canonical tools together.
Defer the entirely new sampling production, tests, assets and their license
as one closure until native record and binary-collector support is ready.
Retain canonical pstats for deterministic empty-profile handling; its
upstream sampled-file sorting issue is not patched here.

Assisted-by: dot:GPT-6.1

* Stage profiling root as a namespace until sampling is available

Omit the whole newly added canonical package initializer rather than
advertise an absent sampling module or hand-edit canonical __all__.
Explicit profiling.tracing and cProfile imports remain available.
The namespace root intentionally lacks canonical metadata/automatic exports.

This addresses test___all__ failures in the prior Linux, macOS and Windows
CI runs. No test assertions, skips or canonical file contents are changed.

Assisted-by: dot:GPT-6.1

* Match canonical static builtin profiler labels and metadata

Normalize the raw builtin receiver instead of its call-argument accessor.
Snapshot static method module metadata at construction, matching CPython,
so explicit module mutation and deletion remain observable. Avoid a
profiler-time fallback that would obscure deleted metadata.

Correct float.__getformat__ to CPython's classmethod calling convention,
including subclass binding, rather than special-casing its profiler label.

Assisted-by: dot:GPT-6.1

* Support collision-safe frozen package containers

Generate empty frozen packages only for source namespace directories with
real frozen descendants. Preserve genuine modules and packages across
frozen-library registrations while retaining real-real replacement order.

Record the container marker in FrozenModule and its library envelope;
legacy module/package encodings remain unchanged. This is closed-tree
frozen packaging, not full PEP 420 namespace merging.

Add structural codec, mock generator, and registration-priority checks.

* Revert frozen package containers before restoring canonical profiling root

The container implementation changed filesystem namespace precedence.
Restore the existing importer and frozen envelope unchanged; the following
offline sampling closure restores the canonical regular package root.

This reverses d5a8049234.

Assisted-by: dot:GPT-6.1

* Restore canonical profiling package with offline sampling codec

Provide native records, status constants and genuine uncompressed binary
reader/writer APIs for canonical offline tools. Keep the unsupported live
process capability absent and preserve existing canonical test gates.
Restore the complete selected sampling production/test/assets closure via
update_lib, including its asyncio frame-schema dependency. The prior frozen
container extension is reverted separately; canonical packages work with
both filesystem and frozen imports without changing namespace semantics.

Assisted-by: dot:GPT-6.1

* Keep platform-dependent C long normalization explicit

Allow only the c_long-to-i32 conversion lint: Windows uses the same type,
while LP64 requires the existing truncation to match CPython normalization.
No runtime behavior or test assertions change.

Assisted-by: dot:GPT-6.1

* Include profiling notices in library and desktop packages

Bundle a byte-identical copy of the root profiling notice in rustpython-pylib
and include the root notice in configured desktop resources. Avoid a symlink
so Windows checkouts preserve the actual notice text. Terms are unchanged.

Assisted-by: dot:GPT-6.1

* Keep profiling asset license notice in pylib crate

* Serve frozen profiling assets through native resource readers

* Preserve canonical profiling asset line endings on checkout

---------

Co-authored-by: youknowdot <dot@youknowone.org>
2026-10-22 11:18:03 +09:00
youknowdot 3b87cbe559 Mark wrapper descriptors as method descriptors (#9286)
* Mark wrapper descriptors as method descriptors

Match CPython 3.15 wrapper_descriptor flags so existing method lookup
can use the descriptor's direct receiver-prepending dispatch path.

Assisted-by: OpenAI Codex:model-version-unavailable

* Retire fixed wrapper monitoring expected failure

Regenerate test_monitoring from pinned CPython 3.15.0 with the updater, preserving every other adaptation. The METHOD_DESCRIPTOR flag now supplies the canonical receiver in int.__repr__ CALL/C_RETURN events.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:15:53 +09:00
youknowdot 4bd4320932 Align coroutine await-result diagnostics with Python 3.15 (#9284)
Report the qualified awaitable and returned type when __await__ does not
produce an iterator, preserving the existing coroutine/iterator checks.
Migrate test_coroutines.py from pinned CPython v3.15.0 through update_lib.

Assisted-by: OpenAI Codex:model-version-unavailable
2026-10-22 10:13:11 +09:00
Jeong, YunWonandyouknowdot bcfad3554e Align symbol table introspection with Python 3.15 (#9277)
Accept the module keyword when building symbol tables and emit only parser
warnings through the existing bounded warning path. Preserve source filenames
and warning-to-SyntaxError conversion without compiling bytecode.

Expose canonical lambda and generator-expression names while retaining
already-bracketed comprehension names. Synchronize symtable and its tests
from pinned CPython 3.15.0 through update_lib, including cell introspection.

Assisted-by: OpenAI Codex:model-version-unavailable

Co-authored-by: youknowdot <dot@youknowone.org>
2026-10-22 01:54:22 +09:00
Jeong, YunWonandyouknowdot a2c864208c Keep the mutex handoff test waiter locked until observation (#9273)
Hold the existing waiter's lock through the parent's immediate fast-acquire
sample, then release and join it before asserting the recorded outcome.
Do not change the production mutex or its existing fairness setup delay.

Assisted-by: OpenAI Codex:model-version-unavailable

Co-authored-by: youknowdot <dot@youknowone.org>
2026-10-22 01:09:10 +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
youknowdotandJeong YunWon 97bd4af533 Add interpreter-bound operation critical sections (#9215)
* Factor shared interpreter stop-the-world guard

Move the existing collector barrier into the VM without changing its stop, restart or ownership behavior, preparing reuse by fork.

Assisted-by: dot:GPT-6.1

* Add interpreter-bound operation section primitive

Prepare attached-only ownership acquisition and detached observer parking with private per-interpreter scope stacks. Lifecycle wiring follows separately; no profiler consumer is enabled by this commit.

Assisted-by: dot:GPT-6.1

* Suspend operation sections at VM lifecycle boundaries

Integrate detach, stop-the-world, shutdown and interpreter-switch boundaries. Reuse the all-interpreter barrier for fork repair and add focused native ownership invariants.

Assisted-by: dot:GPT-6.1

* Replace operation sections with PyMutex critical sections

Add PyMutex with the lock.c protocol: LOCKED/HAS_PARKED bits, a bounded
spin, direct handoff to waiters parked longer than 1 ms, and detaching
while parked.

Rebuild critical sections on PyMutex with the stack kept as a tagged
pointer in ThreadSlot: single and two-mutex sections, recursive
top-most skipping, locking skipped while the world is stopped,
SuspendAll on detach/suspend/shutdown and Resume of the top-most
section on attach. Fork carries the stacks into the replacement slots.

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

* Check attachment around critical-section suspension

Assert that a thread entering a critical section is attached, and
suspend sections in do_suspend only while the slot is still ATTACHED.

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

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-21 19:57:21 +09:00
youknowdot 70a2cb20b5 Preserve surrogates in ImportError repr (#9252)
Use the existing WTF-8 representation interface for the base exception and name/path fields, avoiding lossy conversion of legal Python __repr__ results.

AI assistance: OpenAI Codex prepared the correction and validation. Model version is not exposed in this session.

Assisted-by: Codex:unknown (model version not exposed)
2026-10-21 12:43:30 +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
youknowdot 587358ba5c Support private names in native pickle globals and bound methods (#9259)
Preserve WTF-8 dotted paths in protocol 4/5 global loading so private-name round trips also support surrogate-containing names.

Assisted-by: Codex:unknown (model version not exposed)
2026-10-21 11:57:16 +09:00
youknowdot bb97696c9c Include name and path in ImportError repr (#9247)
Extract the independent Python 3.15 ImportError representation change from the upgrade work. Preserve BaseException positional arguments and include explicitly present name/path attributes for ImportError and ModuleNotFoundError.

AI assistance: OpenAI Codex prepared the extraction and validation. Model version is not exposed in this session.

Assisted-by: Codex:unknown (model version not exposed)
2026-10-20 23:50:19 +09:00
1ndahous3 ebb6a78521 Preserve reflected multiplication for sequence subclasses (#9228)
Assisted-by: Codex:GPT-6
2026-10-20 22:40:26 +09:00
youknowdotandJeong YunWon 70c3f6c06d Align signal wakeup errors and delivery with Python 3.15 (#9199)
* Align signal wakeup error handling with Python 3.15

Assisted-by: OpenAI Codex:model version unavailable

* Preserve CRT error state during signal wakeup writes

Assisted-by: OpenAI Codex:model version unavailable

* Represent nullable Windows CRT parameter handlers safely

Assisted-by: OpenAI Codex:model version unavailable

* Rework signal wakeup error delivery to follow signalmodule.c

- Report pending wakeup write/send errors after Python signal handlers
  and VM pending calls, and re-arm the eval breaker when a handler or
  pending call raises.
- Save and restore errno once in run_signal around trip_signal instead
  of inside each write path; stop preserving _doserrno.
- Add crt_fd::write_noraise and use it for the Unix and Windows wakeup
  writes, sharing the single-write helper with _write.
- Keep pending wakeup errors across fork.
- Revert the suppress_iph handler type change and the unrelated quote
  change in test_signal.

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

* Represent nullable Windows CRT parameter handlers as Option

_set_thread_local_invalid_parameter_handler takes and returns a nullable
function pointer; declare it as Option<InvalidParamHandler> so a NULL
previous handler is restored as None.

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

---------

Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2026-10-20 20:08:49 +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 1be1628666 Report fatal explicit-home startup failures (#9227)
* Report fatal explicit-home encodings initialization failures

Retain explicit standard-library initialization errors for the command-line host, preserving default embedding fallback and the original exception cause.

Assisted-by: OpenAI Codex: model version unavailable

* Enable canonical fatal startup path configuration coverage

Retire the verified expected failure through update_lib, preserving the explicit local path-environment adaptation and all other markers.

Assisted-by: OpenAI Codex: model version unavailable
2026-10-20 09:27:23 +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