Commit Graph

15976 Commits

Author SHA1 Message Date
Jeong, YunWon
5cc589980c Infer struct sequence module name from __module__ attribute in repr
slot_repr now checks the __module__ attribute set by #[pymodule]
at runtime, so explicit module = "..." in #[pystruct_sequence] is
no longer needed for types defined inside a #[pymodule].
2026-02-21 14:23:49 +09:00
Jeong, YunWon
add253912e Implement sys.call_tracing, sys._current_exceptions
- Add sys.call_tracing as func(*args) dispatch
- Add sys._current_exceptions with per-thread exception tracking
  via thread_exceptions registry synced on push/pop/set_exception
- Fix f_back to use previous_frame pointer and cross-thread lookup
- Add module="sys" to float_info struct sequence
- Fix sys.exit to unpack tuple args
- Set default stdio_errors to surrogateescape
- Remove noisy __del__ warning in object core
2026-02-21 14:12:18 +09:00
CPython Developers
edca2dddf1 Update test_sys from v3.14.3 2026-02-21 14:12:18 +09:00
dependabot[bot]
9611b88788 Bump keccak from 0.1.5 to 0.1.6 (#7192)
Bumps [keccak](https://github.com/RustCrypto/sponges) from 0.1.5 to 0.1.6.
- [Commits](https://github.com/RustCrypto/sponges/compare/keccak-v0.1.5...keccak-v0.1.6)

---
updated-dependencies:
- dependency-name: keccak
  dependency-version: 0.1.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-02-20 23:14:21 +09:00
Jeong, YunWon
6ced4409ac force_unlock_after_fork (#7186) 2026-02-20 09:53:01 +09:00
wvmscs
dfc5de701b Fix re.fullmatch POSSESSIVE_REPEAT (#7187) 2026-02-20 09:51:34 +09:00
Shahar Naveh
eddb8f271a Newtype oparg for StoreFastLoadFast (#7191) 2026-02-20 08:19:12 +09:00
Lee Dogeon
41ea698f6a Update test_collections from v3.14.3 (#7189) 2026-02-19 08:48:33 +09:00
Jeong, YunWon
80d7850866 Merge pull request #7188 from moreal/update-3.14.3-types
Update types from v3.14.3
2026-02-18 21:49:19 +09:00
Lee Dogeon
3d33bea285 Remove expectedFailure from test_types_coroutine_wrapper_state
The types.py upgrade added gi_suspended to _GeneratorWrapper,
fixing this test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:39:56 +09:00
Lee Dogeon
24e51ee98c Mark failing tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:38:44 +09:00
CPython Developers
8cbf870238 Update types from v3.14.3 2026-02-18 17:19:49 +09:00
Jeong, YunWon
8e70048891 Merge pull request #7165 from youknowone/ctypes
Update ctypes from v3.14.3 and make _ctypes compatible
2026-02-18 08:21:27 +09:00
github-actions[bot]
8b50737914 Auto-format: cargo fmt --all 2026-02-17 18:11:21 +00:00
Jeong, YunWon
38d54fa0cd impl more ctypes
- Add __pointer_type__ getter/setter and StgInfo cache
- Add kept_refs (HashMap-keyed) for c_char_p lifetime
- Simplify ensure_z_null_terminated to 2-value return
- Add RawMemoryBuffer for zero-copy memoryview_at_addr
- Add bitfield support in PyCField with validation
- Add CArgObject offset handling in extract_ptr_from_arg
- Add deprecation warning for _pack_ without _layout_
- Fix comparison TypeError message format
- Fix unsupported binop error message format
- Mark failing CI tests as expectedFailure/skip
2026-02-18 03:10:40 +09:00
Jeong, YunWon
36a53ddf66 fix buffer whitespace skip 2026-02-18 03:10:14 +09:00
CPython Developers
4b7f1f8751 Update ctypes from v3.14.3 2026-02-18 03:09:55 +09:00
Jeong, YunWon
e81a0fc765 Use try_lock in py_os_after_fork_child (#7178)
after_forkers_child.lock() can deadlock in the forked child
if another thread held the mutex at the time of fork.
Use try_lock and skip at-fork callbacks when the lock is
unavailable, matching the pattern used in after_fork_child
for thread_handles.
2026-02-18 02:24:06 +09:00
Jeong, YunWon
b5785e2777 Use _print_exception_bltin in excepthook, register source in linecache (#7177)
- excepthook: call traceback._print_exception_bltin instead of
  traceback.print_exception to match PyErr_Display behavior
- run_string: register compiled code in linecache._interactive_cache
  so traceback can display source lines and caret indicators
- Remove test_sys_tracebacklimit expectedFailure
2026-02-18 01:50:27 +09:00
Jeong, YunWon
ccccaaf06f Merge pull request #7184 from youknowone/winsound
Update test_winsound from v3.14.3
2026-02-18 00:47:16 +09:00
Lee Dogeon
d07d52224e Optimize redundant bool check (#7176)
* Add compile_bool_op_inner and optimize nested opposite-operator BoolOps to avoid redundant __bool__ calls

When a nested BoolOp has the opposite operator (e.g., `And` inside `Or`),
the inner BoolOp's short-circuit exits are redirected to skip the outer
BoolOp's redundant truth test. This avoids calling `__bool__()` twice on
the same value (e.g., `Test() and False or False` previously called
`Test().__bool__()` twice instead of once).

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

* Add snapshot test for nested BoolOp bytecode

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

* Add runtime test for redundant __bool__ check (issue #3567)

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

* Apply clippy and rustfmt

* Apply ruff format

* Refactor compile_bool_op: extract emit_short_circuit_test and unify with compile_bool_op_inner

Reduce code duplication by:
- Extracting the repeated Copy + conditional jump pattern into emit_short_circuit_test
- Merging compile_bool_op and compile_bool_op_inner into a single
  compile_bool_op_with_target with an optional short_circuit_target parameter
- Keeping compile_bool_op as a thin wrapper for the public interface

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

* Relocate redundant __bool__ check test snippet

* Update extra_tests/snippets/syntax_short_circuit_bool.py

* Fix assertion in syntax_short_circuit_bool

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-02-18 00:45:17 +09:00
Shahar Naveh
f0f3c9c8cf Update csv.py from 3.14.3 (#7181)
* Update `csv.py` from 3.14.3

* Don't hardcode error message for `int` class
2026-02-18 00:43:49 +09:00
Jeong, YunWon
d4d010ec21 Fix unpack_sequence to match CPython behavior (#7175)
Add fast path for exact tuple/list (direct length check without
iterator). General path now iterates only size+1 elements,
fixing hang on infinite sequences like __getitem__ without
raising IndexError.

Error messages now include "got N" for tuple, list, and dict.
Remove 7 expectedFailure/skip markers from test_unpack.
2026-02-18 00:41:53 +09:00
Jeong, YunWon
8fa0c66bc4 Optimize coroutine exception handling and fix gen_throw traceback (#7166)
- Replace ExceptionStack linked list with Vec for O(1) push/pop
- Introduce FramePtr (NonNull<Py<Frame>>) to avoid Arc clone in frame stack
- Use FramePtr in ThreadSlot for lock-protected cross-thread frame access
- Add resume_gen_frame for lightweight generator/coroutine resume
- Replace Coro.exception PyMutex with PyAtomicRef for lock-free swap
- Add with_frame_exc to support initial exception state for generators
- Use scopeguard for panic-safe cleanup in with_frame_exc/resume_gen_frame
- Add traceback entries in gen_throw delegate/close error paths
- Treat EndAsyncFor and CleanupThrow as reraise in handle_exception
- Update current_frame()/current_globals() to return owned values
- Add ThreadSlot with atomic exception field for sys._current_exceptions()
- Push/pop thread frames in resume_gen_frame for sys._current_frames()
2026-02-17 21:35:05 +09:00
Jeong, YunWon
705dd7dddd Implement winsound module
Add PlaySound, Beep, MessageBeep functions and all SND_*/MB_*
constants. Uses Windows APIs via winmm.dll, kernel32, user32.
2026-02-17 21:34:27 +09:00
CPython Developers
b7643c08cf Update test_winsound from v3.14.3 2026-02-17 21:33:54 +09:00
Jeong, YunWon
6b4605280e cap mt19937 version (#7182) 2026-02-17 20:02:28 +09:00
Jeong, YunWon
b87386f4fc Update test_fstring from v3.14.3 and impl more (#7164)
* Update test_fstring from v3.14.3

* Fix 6 test_fstring expectedFailure tests

- Add Unknown(char) variant to FormatType for proper error messages
  on unrecognized format codes (test_errors)
- Strip comments from f-string debug text in compile.rs
  (test_debug_conversion)
- Map ruff SyntaxError messages to match CPython in vm_new.rs:
  InvalidDeleteTarget, LineContinuationError, UnclosedStringError,
  OtherError(bytes mixing), OtherError(keyword identifier),
  FStringError(UnterminatedString/UnterminatedTripleQuotedString),
  and backtick-to-quote replacement for FStringError messages

* Fix clippy::sliced_string_as_bytes warning

---------

Co-authored-by: CPython Developers <>
2026-02-17 16:49:59 +09:00
dependabot[bot]
e3c533a53c Bump github/gh-aw from 0.43.22 to 0.45.0
Bumps [github/gh-aw](https://github.com/github/gh-aw) from 0.43.22 to 0.45.0.
- [Release notes](https://github.com/github/gh-aw/releases)
- [Changelog](https://github.com/github/gh-aw/blob/main/CHANGELOG.md)
- [Commits](fe858c3e14...58d1d157fb)

---
updated-dependencies:
- dependency-name: github/gh-aw
  dependency-version: 0.45.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 10:31:13 +09:00
dependabot[bot]
ee6ff22947 Bump actions/setup-python from 5.6.0 to 6.2.0
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.6.0 to 6.2.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5.6.0...v6.2.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: 6.2.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 09:44:06 +09:00
dependabot[bot]
5ca3c2894b Bump actions/download-artifact from 6.0.0 to 7.0.0
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 09:43:43 +09:00
dependabot[bot]
3d9480acf9 Bump actions/cache from 4.3.0 to 5.0.3
Bumps [actions/cache](https://github.com/actions/cache) from 4.3.0 to 5.0.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](0057852bfa...cdf6c1fa76)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 5.0.3
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 09:43:25 +09:00
dependabot[bot]
530e4db6ec Bump bitflags from 2.10.0 to 2.11.0
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.10.0 to 2.11.0.
- [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.10.0...2.11.0)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 09:42:42 +09:00
dependabot[bot]
1f338ce201 Bump pyo3 from 0.28.0 to 0.28.1 in the pyo3 group
Bumps the pyo3 group with 1 update: [pyo3](https://github.com/pyo3/pyo3).


Updates `pyo3` from 0.28.0 to 0.28.1
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.28.0...v0.28.1)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-version: 0.28.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: pyo3
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-17 09:42:28 +09:00
ShaharNaveh
d71ffa6c47 Use shared doctest checker 2026-02-17 01:31:29 +09:00
ShaharNaveh
0832828953 Update test_unpack.py from 3.14.3 2026-02-16 23:34:17 +09:00
Jeong, YunWon
79453c3e6d Merge pull request #7141 from youknowone/execve
Accept any mapping for os.execve env argument
2026-02-16 03:22:51 +09:00
Jeong, YunWon
243beb692b Merge pull request #7151 from youknowone/winconsoleio
_WindowsConsoleIO
2026-02-16 01:51:24 +09:00
ShaharNaveh
c76fb0145b Update test_richcmp.py from 3.14.3 2026-02-16 01:19:57 +09:00
Jeong, YunWon
72b4ef31a2 Accept any mapping for os.execve env argument
Change env parameter from PyDictRef to ArgMapping so that
EnvironmentVarGuard and other mapping types are accepted.
2026-02-16 01:03:18 +09:00
Jeong, YunWon
7b1db4868a Merge pull request #7162 from youknowone/wmi
impl _wmi module
2026-02-16 00:52:05 +09:00
CPython Developers
8552e42d94 Update test_winconsoleio from v3.14.3 2026-02-16 00:31:57 +09:00
Jeong, YunWon
8e06707fc6 Implement _WindowsConsoleIO and _testconsole module
Add _WindowsConsoleIO class to _io module with ReadConsoleW/WriteConsoleW support.
Add _testconsole stdlib module with write_input for console input simulation.
Integrate console detection in io_open to use _WindowsConsoleIO for console handles.
2026-02-16 00:28:51 +09:00
Jeong, YunWon
4897e0322d Add _wmi module
Implement _wmi.exec_query via COM/WMI using pipe+thread
pattern matching _wmimodule.cpp. Uses raw COM vtable calls
for IWbemLocator, IWbemServices, IEnumWbemClassObject, and
IWbemClassObject interfaces.
2026-02-15 23:44:23 +09:00
CPython Developers
09b528168e Update test_wmi from v3.14.3 2026-02-15 23:44:23 +09:00
Jeong, YunWon
4f366d7937 Skip flaky test_main_thread_after_fork_from_nonmain_thread 2026-02-15 23:42:09 +09:00
ShaharNaveh
3047a63941 Update test_scope.py from 3.14.3 2026-02-15 23:40:14 +09:00
Jeong, YunWon
b4edd547dc Merge pull request #7159 from youknowone/hashlib
_hashlib.HMAC and Update hmac from v3.14.3
2026-02-15 23:38:55 +09:00
Shahar Naveh
e1db19c892 Update test_with.py from 3.14.3 (#7158) 2026-02-15 23:38:22 +09:00
Jeong, YunWon
5530855436 Make __hello_only__ a frozen-only alias of __hello__ (#7160)
Remove __hello_only__.py source file and its symlink. Register
__hello_only__ as a frozen module alias reusing __hello__ bytecode,
matching the behavior where origname is None (no source file).
2026-02-15 22:25:28 +09:00