Commit Graph
16015 Commits
Author SHA1 Message Date
Jeong, YunWon ece2cc1c40 mark failing tests 2026-02-27 09:07:23 +09:00
Jeong, YunWon eb370e500c Implement side-table instrumented opcode execution
Add CoMonitoringData with line_opcodes and per_instruction_opcodes
side-tables. INSTRUMENTED_LINE and INSTRUMENTED_INSTRUCTION read
original opcodes from side-tables and re-dispatch after firing events.

- Add decode_exception_table() and CodeUnits::replace_op()
- Add Instruction::to_instrumented/to_base/is_instrumented mappings
- Three-phase instrument_code: de-instrument, re-instrument regular,
  then layer INSTRUCTION and LINE with side-table storage
- Mark exception handler targets as line starts in LINE placement
- InstrumentedLine resolves side-table chain atomically when wrapping
  InstrumentedInstruction
- InstrumentedForIter fires both BRANCH_LEFT and BRANCH_RIGHT
- Remove callback on DISABLE return for non-local events
2026-02-27 09:07:22 +09:00
Jeong, YunWon 7af8721719 instrumented instructions 2026-02-27 09:06:56 +09:00
CPython Developers d77c7f2519 Update test_compile from v3.14.3 2026-02-27 09:06:56 +09:00
Jeong, YunWon a059bd2958 impl sys.monitoring 2026-02-27 09:06:55 +09:00
Jeong, YunWon cf2b223c87 patch test_monitoring not to entirely skipped 2026-02-27 04:36:46 +09:00
CPython Developers 70942d3333 Update test_monitoring from CPython 3.14.3 2026-02-27 04:36:46 +09:00
Jeong, YunWon 7311b87c7b Remove PyStr::as_str, use as_wtf8/PyUtf8Str instead (#7218)
- Remove as_str() from PyStr/Py<PyStr> (was panicking on surrogates)
- Add Wtf8Concat trait and concat! macro for WTF-8 formatting
- Add impl From<&str> for &Wtf8 conversion
- Add AsPyStr/DictKey impls for PyUtf8Str types
- Migrate all call sites to as_wtf8(), to_str(), or PyUtf8Str
- Fix exception message APIs to accept Wtf8Buf
- Deduplicate inner-scope imports across modules
2026-02-27 04:20:11 +09:00
Jeong, YunWon 35e897e58a Revert "ast.NodeVisitor for import tracking (#7229)" (#7230)
This reverts commit 804a7e42fc.
2026-02-27 03:55:13 +09:00
Shahar Naveh 07159eb9a1 ast.NodeVisitor for import tracking (#7229) 2026-02-27 03:07:57 +09:00
Jeong, YunWon 8df1a2b05d Clear frame locals and stack on generator close + Add dir_fd support for rmdir, remove/unlink, scandir (#7222)
* Clear frame locals and stack on generator close

Add Frame::clear_locals_and_stack() to release references held by
closed generators/coroutines, matching _PyFrame_ClearLocals behavior.
Call it from Coro::close() after marking the coroutine as closed.

Update test_generators.py expectedFailure markers accordingly.

* Add dir_fd support for rmdir, remove/unlink, scandir

- rmdir: use unlinkat(fd, path, AT_REMOVEDIR) when dir_fd given
- remove/unlink: use unlinkat(fd, path, 0) when dir_fd given
- scandir: accept fd via fdopendir, add ScandirIteratorFd
- listdir: rewrite fd path to use raw readdir instead of nix::dir::Dir
- DirEntry: add d_type and dir_fd fields for fd-based scandir
- Update supports_fd/supports_dir_fd entries accordingly

* cells_free
2026-02-27 01:58:33 +09:00
Shahar Naveh 0ea84cdf12 update_lib test format fix + deps for atexit & eintr (#7227)
* update_lib deps for atexit & eintr

* Fix test format
2026-02-26 12:03:47 +09:00
Shahar Naveh fbb65cc738 Update compileall.py to 3.14.3 (#7225) 2026-02-25 21:15:55 +09:00
Shahar Naveh 8a85708092 Don't skip test_glob on windows (#7224) 2026-02-25 21:01:51 +09:00
Copilot 033249e1b3 Fix upgrade-pylib workflow to use Python 3.14 (#7216) 2026-02-24 16:22:44 +09:00
CPython Developers 2abc1386c6 Update annotationlib from v3.14.3 2026-02-24 16:22:44 +09:00
CPython Developers e461a0a7b9 Update zipfile from v3.14.3 2026-02-24 14:23:19 +09:00
Jeong, YunWon 7aa38ebe9f Implement Windows SemLock in _multiprocessing module (#7199)
* Implement Windows SemLock in _multiprocessing module

Add SemLock class using Windows semaphore APIs (CreateSemaphoreW,
WaitForSingleObjectEx, ReleaseSemaphore) so test_multiprocessing
suites are no longer skipped with "lacks a functioning sem_open".
Also add sem_unlink as no-op and flags dict for Windows.

* Fix _multiprocessing recv to return bytes and improve SemLock reliability

- recv() now returns bytes instead of int (matching CPython)
- Remove spurious GetLastError() check after CreateSemaphoreW
- Add signal checking during blocking SemLock acquire

* Include winerror in OSError.__reduce__ on Windows

* Remove expectedFailure for tests now passing with Windows SemLock

* Fix OSError.__reduce__ to preserve winerror when filename is None

When filename is None, __reduce__ was reconstructing a 2-element
(errno, msg) tuple, dropping the winerror at position 3 in the
original args. Use the original args tuple instead, matching CPython.

* Validate maxvalue > 0 in SemLock and document winerror __reduce__ divergence

* Reject embedded null characters in mmap tagname and _winapi file mapping names
2026-02-24 10:12:29 +09:00
Shahar Naveh d412c10e6b Update datetime to 3.14.3 (#7084) 2026-02-24 01:07:30 +00:00
Jeong, YunWon 061c709434 cold block reordering and jump normalization (#7210)
* cold block reordering and jump normalization

Add mark_cold, push_cold_blocks_to_end, and normalize_jumps
passes to the codegen CFG pipeline. Use JumpNoInterrupt for
exception handler exit paths in try-except-finally compilation.

* mark test_peepholer
2026-02-24 08:53:07 +09:00
Jeong, YunWon 584382b801 [workflow] fix upgrade-pylib (#7211) 2026-02-24 00:15:55 +09:00
dependabot[bot] 3e9b28e442 Bump github/gh-aw from 0.45.0 to 0.49.4 (#7209)
Bumps [github/gh-aw](https://github.com/github/gh-aw) from 0.45.0 to 0.49.4.
- [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/58d1d157fbac0f1204798500faefc4f7461ebe28...bf34f9947505c887fdc597a13b8ff277cccd9c20)

---
updated-dependencies:
- dependency-name: github/gh-aw
  dependency-version: 0.49.4
  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-02-23 23:36:55 +09:00
Jeong, YunWon cb7f19c316 Implement Windows named mmap via CreateFileMappingW (#7207)
Use Win32 CreateFileMappingW + MapViewOfFile when tagname is
provided, enabling inter-process shared memory for
multiprocessing.heap.Arena. Anonymous mmaps without tagname
still use memmap2.

Remove expectedFailure from test_tagname in test_mmap.py.
2026-02-23 23:32:52 +09:00
Jeong, YunWon 25437b99d5 Merge pull request #7203 from youknowone/pymodule
#[pymodule] submodule support and implicit module_name inheritance
2026-02-23 22:17:06 +09:00
Jeong, YunWon 239c8fba5c implicit module_name under #[pymodule] 2026-02-23 22:16:44 +09:00
Jeong, YunWon 6a1015c108 support sub-module from #[pymodule] 2026-02-23 22:16:40 +09:00
Jeong, YunWon ab059f963c skip flaky test (#7208) 2026-02-23 22:08:50 +09:00
Jeong, YunWon b39a3a1248 Fix deadlock after fork (#7205)ㅐ 2026-02-23 16:22:26 +09:00
Jeong, YunWon c1e0520120 Fix EINTR handling (#7204) 2026-02-23 16:13:24 +09:00
CPython Developers ce0f9dd057 Update test_gc from v3.14.3 2026-02-23 08:48:18 +09:00
Jeong, YunWon 9014ecc6cd Fix Overlapped I/O by boxing OVERLAPPED struct and accept overlapped arg positionally (#7198)
Two fixes in _winapi:

1. Box the OVERLAPPED struct in OverlappedInner to ensure it stays at
   a stable heap address. Previously, into_pyobject() moved the struct
   after ReadFile/WriteFile had given the OS a pointer to it, causing
   GetOverlappedResult to read stale data (returning err=0 instead of
   ERROR_MORE_DATA for zero-byte reads on message pipes).

2. Change ReadFile, WriteFile, ConnectNamedPipe overlapped parameter
   from #[pyarg(named)] to #[pyarg(any)] so it can be passed both
   positionally and as keyword argument.
2026-02-22 22:14:06 +09:00
Jeong, YunWon 8a74956590 more algorithm-independent GC infra (#7194)
* mark poluting tests

* GC-infra independent to EBR

* trashcan

* add overflow guard to inc(), #[must_use] on dec()/safe_inc(), trashcan debug_assert, weakref generic re-check
2026-02-22 21:31:42 +09:00
Jeong, YunWon f9f9e168ae Remove recreate:true from lib-deps-check (#7201) 2026-02-22 20:27:14 +09:00
Jeong, YunWon ab2876f33c Add missing _winapi functions (#7185)
* Add missing _winapi functions and fix WinHandle int conversion

Add 13 functions: ReadFile, SetNamedPipeHandleState, CreateFileMapping,
OpenFileMapping, MapViewOfFile, UnmapViewOfFile, VirtualQuerySize,
CopyFile2, ResetEvent, CreateMutex, OpenEventW, LoadLibrary,
_mimetypes_read_windows_registry.

Add constants: INVALID_HANDLE_VALUE, FILE_MAP_READ/WRITE/COPY/EXECUTE.

Change WinHandle integer type from usize to isize so negative values
like INVALID_HANDLE_VALUE (-1) can be passed from Python.

* Align _winapi module with CPython

- Rename winapi.rs to _winapi.rs with #[path] attribute
- Rename CreateMutex to CreateMutexW
- Add missing constants: ERROR_ACCESS_DENIED, ERROR_PRIVILEGE_NOT_HELD,
  PROCESS_ALL_ACCESS, 10 STARTF_ constants, LOCALE_NAME_SYSTEM_DEFAULT,
  LOCALE_NAME_USER_DEFAULT, COPY_FILE_DIRECTORY
- Fix OpenMutexW return type and ReleaseMutex param type to use WinHandle

* Fix ReadFile/WriteFile overlapped keyword argument

Use FromArgs structs so overlapped parameter can be passed as
a keyword argument (overlapped=True), matching the CPython API.

* Remove extra constants and LoadLibrary not in CPython _winapi

Remove 19 constants (WAIT_ABANDONED, CREATE_ALWAYS, CREATE_NEW,
OPEN_ALWAYS, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, 8 FILE_FLAG_*,
3 FILE_SHARE_*, NMPWAIT_NOWAIT, NMPWAIT_USE_DEFAULT_WAIT) and
LoadLibrary function that are not present in CPython's _winapi module.

* Fix utf8_mode default to 0 and add PYTHONUTF8 env var support

Default utf8_mode was incorrectly set to 1, causing text-mode
subprocess to always decode as UTF-8 instead of locale encoding.
Changed default to 0 to match CPython 3.13 behavior on Windows.
Added PYTHONUTF8 environment variable handling with -X utf8 override.

* Fix CopyFile2 to raise proper OSError subclass

Use std::io::Error::from_raw_os_error instead of vm.new_os_error so
that winerror attribute is set and errno-to-exception mapping works
(e.g. ERROR_ACCESS_DENIED → PermissionError).

* Fix syntax_non_utf8 test to not depend on locale encoding

Use explicit encoding='latin-1' so the test works regardless of
the system locale (e.g. C/POSIX locale uses ASCII by default).
2026-02-22 19:54:27 +09:00
Jeong, YunWon 2458e34091 Merge pull request #7195 from youknowone/sys
StatelessIncrementalEncoder, sys attributes
2026-02-22 00:30:56 +09:00
Jeong, YunWon 553c26b64c Move sys.flags thread_inherit_context/context_aware_warnings to getset 2026-02-21 22:58:12 +09:00
Jeong, YunWon b31b66c3d3 Register latin-1 codec and fix stdio bootstrap 2026-02-21 22:58:12 +09:00
Jeong, YunWon 8b7d66f566 Fix WindowsVersionData n_sequence_fields 2026-02-21 22:58:12 +09:00
Jeong, YunWon 418e153d88 Merge pull request #7075 from youknowone/sys
Update test_sys from v3.14.3 and impl more sys module
2026-02-21 19:26:58 +09:00
Jeong, YunWon 7eba3050bf 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 423b29c306 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 f520a7d456 Update test_sys from v3.14.3 2026-02-21 14:12:18 +09:00
dependabot[bot] d57e0836a5 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 1f1123db75 force_unlock_after_fork (#7186) 2026-02-20 09:53:01 +09:00
wvmscs c7e94dd1a8 Fix re.fullmatch POSSESSIVE_REPEAT (#7187) 2026-02-20 09:51:34 +09:00
Shahar Naveh 1ac52b9187 Newtype oparg for StoreFastLoadFast (#7191) 2026-02-20 08:19:12 +09:00
Lee Dogeon 550cc44fbd Update test_collections from v3.14.3 (#7189) 2026-02-19 08:48:33 +09:00
Jeong, YunWon 8dd70fe471 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 DogeonandClaude Opus 4.6 0fdd3a669c 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 DogeonandClaude Opus 4.6 27a986a843 Mark failing tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 18:38:44 +09:00