Commit Graph
4711 Commits
Author SHA1 Message Date
Shahar Naveh 4daa526dc1 Update tzinfo to 3.14.5 (#7934)
* Update `tzinfo` to 3.14.5

* Mark failing tests
2026-05-20 23:09:50 +09:00
Shahar Naveh d073964aaa Remove unused binaries (#7936) 2026-05-20 22:21:04 +09:00
Shahar Naveh ee006af13e Align more error messages with CPython 3.14.5 (#7933)
* Align more error messages with CPython 3.14.5

* Align patches for `test_eof.py`

* Unmark passing test

* Fix more
2026-05-20 22:20:13 +09:00
Jeong, YunWon ae3804fb21 more hostenv isolation (#7886)
* Convert host_env Windows path/argv params from raw *const u16 to &WideCStr

* Migrate remaining winapi raw u16 pointer signatures to typed references

* Migrate winreg pub unsafe fn string parameters to typed references

* Add ToPyException impls for host_env error types (PyPy wrap_oserror analog)

* Add CheckLibcResult helper and apply to socket/fcntl/shm/posix_wasi

* Add Win32 BOOL/HANDLE check helpers; apply check helpers across host_env

* Apply Win32/libc check helpers to overlapped/testconsole/os.rs

* Apply Win32 check helpers to winapi.rs (partial)

* Apply Win32 check helpers across more winapi.rs functions

* Apply Win32 check helpers to nt.rs (partial)

* Add CheckWin32Sentinel helper; apply to nt.rs INVALID_HANDLE_VALUE/INVALID_FILE_ATTRIBUTES patterns

* Add OwnedHandle / HandleToOwned helper; apply to mmap create_named_mapping leak path

* Use OwnedHandle RAII in nt::pipe to eliminate manual cleanup on error path

* Use OwnedHandle in nt::chmod_follow; hoist HandleToOwned import

* Drop rustix dependency from vm crate

Remove unused IntoPyException impl for rustix::io::Errno and the
rustix entry in crates/vm/Cargo.toml. rustix is now only depended on
by host_env.

* Fix CI failures: cross-platform regressions

- winapi.rs: pass None to create_event_w; the recent Option<&WideCStr>
  migration left one call site still passing a raw null pointer.
- exceptions.rs: gate ToPyException for LockfError with
  cfg(any(unix, target_os = "wasi")), matching host_env::fcntl's own
  cfg. The previous cfg let it compile on wasm32-unknown-unknown where
  host_env::fcntl does not exist.
- io_unsupported.rs: derive Eq on FileMode alongside PartialEq to
  satisfy clippy::derive_partial_eq_without_eq.

* Fix CI failures: cfg gates and unused imports

- exceptions.rs: gate ToPyException for LockfError with
  cfg(all(unix, not(target_os = "redox"))) to match the type's own
  cfg in host_env/src/fcntl.rs (LockfError is not built on wasi).
- signal.rs: CheckLibcResult is only used in unix-gated functions;
  split import so it is not pulled in for windows.
- mmap.rs: remove CheckWin32Handle from imports; no longer used after
  switching to HandleToOwned-based RAII.
- overlapped.rs: remove INVALID_HANDLE_VALUE from connect_pipe import;
  the call now uses .check_valid().

* Fix CI failures: rustfmt and windows unused import

- signal.rs: reorder cfg-gated imports per rustfmt.
- socket.rs: gate ToPyException import to cfg(all(unix, not(target_os = "redox")));
  it is only used inside sendmsg which has the same gate, so it was unused
  on windows.

* Push remaining libc/extern callsites from vm into host_env

Add host_env wrappers and replace the corresponding vm call sites:
- host_env::errno::strerror_string for libc::strerror
- host_env::io::write_stderr_raw for libc::write(STDERR_FILENO,...)
- host_env::locale::localeconv_data reused from vm::format
- host_env::os::abort for the inline abort extern
- host_env::os::urandom wraps getrandom; getrandom moves from vm to host_env
- host_env::posix::lchmod for the macOS/BSD lchmod extern
- host_env::posix::fcopyfile for the macOS fcopyfile extern
- host_env::nt::wputenv for the Windows _wputenv extern

vm/format.rs's get_locale_info now uses host_env on both unix and windows
instead of the unix-only libc::localeconv path.

* Move time tz state and winsound FFI into host_env

- host_env::time::tz: wraps the libc tzset/timezone/daylight/tzname
  globals on non-msvc, non-wasm32 targets. vm::stdlib::time now reads
  these via the typed wrappers instead of declaring its own externs.
- host_env::winsound (windows): exposes PlaySoundW (via a typed
  PlaySoundSource enum), Beep, and MessageBeep. vm::stdlib::winsound
  drops its inline FFI block and routes through host_env.

* Migrate unsetenv to host_env::nt::wputenv; rustfmt

- vm::stdlib::os::unsetenv had a second _wputenv call site that still
  referenced the removed inline extern. Route it through
  host_env::nt::wputenv like putenv.
- rustfmt fixups in exceptions.rs (boolean chain layout) and the two
  winsound files.

* Address PR review comments

- host_env::winapi::create_process: assert that the command_line buffer
  is NUL-terminated and that the env block ends with a double-NUL,
  matching the Win32 CreateProcessW contract.
- stdlib::overlapped CreateEvent: replace WideCString::from_str_truncate
  with the fallible from_str(), so embedded NULs in the event name
  surface as ValueError instead of being silently truncated.
- vm::exceptions::ReadlinkError::NotSymbolicLink now maps to OSError
  (matches Win32 ERROR_NOT_A_REPARSE_POINT semantics) rather than
  ValueError.
- winreg::ConnectRegistry: route the non-zero return through the
  existing os_error_from_windows_code helper so the resulting exception
  carries the real winerror/message instead of a generic OSError.

* Fix CI failures and address review follow-ups

CI failures:
- rustfmt cleanup in exceptions.rs after the ReadlinkError change.
- vm/stdlib/os.rs: drop unused ToWideString import that the wputenv
  migration left behind.
- vm/stdlib/winsound.rs: replace explicit `&*buf` with `&buf` to
  satisfy clippy::explicit_auto_deref.
- Lib/test/test_format.py, Lib/test/test_types.py: drop the now-stale
  expectedFailureIfWindows decorators on the locale-format tests; the
  Windows path now reads real `localeconv` data via host_env so these
  tests pass.

Review follow-ups:
- host_env::winapi::create_process: switch the new buffer terminator
  checks from `assert!` to fallible validators returning
  `io::ErrorKind::InvalidInput`, so bad inputs stay recoverable at
  the API boundary.
- host_env::winsound::play_sound: reject `Memory(_)` together with
  `SND_ASYNC` (lifetime-unsafe) and `SND_MEMORY` without a
  `Memory(_)` source. Expand `PlaySoundError` into a variant enum.
- vm::stdlib::_winapi::CreateProcess: route the Win32 path/argv strings
  through `as_wtf8().to_wide_cstring()` like the rest of the Windows
  API surface; `expect_str()` could panic on Python strings containing
  lone surrogates.
2026-05-20 16:16:14 +09:00
Shahar Naveh 0063a6d18b Align more error messages with CPython 3.14.5 (#7928) 2026-05-20 08:59:59 +09:00
Jeong, YunWon 62b081b893 Resolve test_inspect bytecode parity gaps (#7926)
* Resolve test_inspect bytecode parity gaps

* Address code review feedback
2026-05-19 22:47:58 +09:00
Shahar Naveh 0a2461a704 Update test_grammar.py to 3.14.5 (#7913)
* Update `test_grammar.py` to 3.14.5

* Update `test_syntax.py` to 3.14.5
2026-05-19 20:59:00 +09:00
Jeong, YunWon d8dee81157 Bytecode parity (#7885)
* Align codegen CFG cleanup with CPython

* Align codegen bytecode with CPython 3.14

* Remove remove_jump_target_line_nops

The pass dropped a same-line NOP at the start of any jump-targeted block
whose body advanced to a later line, but CPython's basicblock_remove_redundant_nops
only consults the previous/next instruction inside the same block. The
extra pass deleted the else-body line trace anchor exercised by
test_nested_double_async_with.

Ignore test_conditional_break_finally_does_not_keep_break_cleanup_nop;
the break NOP lands in a separate block from the inlined finally body,
so same-line successor elision does not apply here.

* Keep except_handler blocks reachable in eliminate_unreachable_blocks

After convert_pseudo_ops lowers SETUP_FINALLY to a plain NOP, the only
remaining link from the try body to the except_handler block was the
per-instruction except_handler annotation. When earlier passes had
already removed every NOP that carried that annotation (e.g. an empty
try body with `pass`), the handler block became unreachable from the
entry block and its instructions were cleared, dropping the handler
entirely. Seed reachability with blocks already marked except_handler
so handler dispatch survives independent of the in-block annotation.

Also drop two expectedFailure markers in test_patma whose match-tracing
expectations now pass.

* Align bytecode CFG cleanup with CPython
2026-05-19 19:24:45 +09:00
Shahar Naveh e8d7437d91 Update test_types.py to 3.14.5 (#7912) 2026-05-19 08:21:19 +00:00
Shahar Naveh 48ad238349 Update some tests to 3.14.5 (#7909)
* Align patches for `test_class.py`

* Update more tests to 3.14.5

* Update `test_math`

* `test_hash.py`

* Update `test_grammar.py`

* Fix failing test

* Restore `test_grammar.py`
2026-05-19 13:31:33 +09:00
Shahar Naveh a4579a98b2 Update NOP tests to 3.14.5 (#7902)
* Update `test_xxlimited.py` & `test_xxtestfuzz.py` to 3.14.5

* Add more NOP tests

* Remove `test_capi`

* Remove `test_cext`
2026-05-19 13:20:00 +09:00
Shahar Naveh 883ce9d273 Update test_xpickle.py to 3.14.5 (#7901) 2026-05-18 00:23:34 +09:00
Shahar Naveh 723766ef69 Don't skip passing ast tests (#7900) 2026-05-18 00:23:22 +09:00
Shahar Naveh 3ed8c91fef Update test/support to 3.14.5 (#7896)
* Update `test/support` to 3.14.5

* Adjuat test markers

* Add `test_set` to env polluting tests
2026-05-18 00:23:06 +09:00
Shahar Naveh 9c188b4da9 Update ctypes to 3.14.5 (#7899) 2026-05-17 20:54:56 +09:00
Shahar Naveh f4f035013d Update test_rlcompleter.py to 3.14.5 (#7898) 2026-05-17 19:50:06 +09:00
Shahar Naveh c77c56d99c Update venv to 3.14.5 (#7897) 2026-05-17 19:49:53 +09:00
Shahar Naveh b432d4cbdc Update pickle.py to 3.14.5 (#7895)
* Update `pickle.py` to 3.14.5

* Update pickle deps with new file

* Mark failing tests
2026-05-17 19:49:42 +09:00
Shahar Naveh 5a5230a400 Update shutil.py & zipfile to 3.14.5 (#7894)
* Update `shutil.py` to 3.14.5

* Update `zipfile` to 3.14.5
2026-05-17 19:49:31 +09:00
Shahar Naveh 8c988711dd Update http to 3.14.5 (#7892)
* Update `http` to 3.14.5

* Restore cpu patch
2026-05-17 19:49:19 +09:00
Shahar Naveh f2ef252724 Update random.py to 3.14.5 (#7890) 2026-05-17 19:49:09 +09:00
Shahar Naveh 4b9416a558 Update test_genexps.py & test_metaclass.py to 3.14.5 (#7884)
* Update `test_genexps.py` to 3.14.5

* Align `test_metaclass.py` with the new doctest checker
2026-05-17 01:59:03 +09:00
Shahar Naveh 7273d76cf2 Update email to 3.14.5 (#7880)
* Update `email` to 3.14.5

* Update `test_email`

* mark failing tests

* Remove ExtraAssertions
2026-05-17 01:57:05 +09:00
Shahar Naveh f26016049d Update tarfile.py to 3.14.5 (#7879) 2026-05-16 19:41:22 +09:00
Jeong, YunWon 8253253fc7 more hostenv impl (#7604) 2026-05-16 19:01:40 +09:00
Joshua Megnauth ef375bec26 Fix swapcase() (#7788)
The tests for swapcase() were failing for two reasons. The first is
'𐐧' casing which should be fixed with modern Unicode tables. The second
failure is due to CPython's sigma override, which I implemented in
PR #7717.
2026-05-13 23:21:45 +09:00
Shahar Naveh f8e0eeb579 Update webbrowser.py to 3.14.5 (#7868) 2026-05-13 19:53:31 +09:00
Shahar Naveh 32e6f8dd81 Update annotationlib.py to 3.14.5 (#7867) 2026-05-13 19:53:18 +09:00
Shahar Naveh e36cd994e8 Update socket.py to 3.14.5 (#7866)
* Update `socket.py` to 3.14.5

* Don't have socket.sethostname on android

* Mark failing test
2026-05-13 19:52:56 +09:00
Shahar Naveh 79395de9f3 Update test_xml_etree.py to 3.14.5 (#7855) 2026-05-12 22:19:57 +09:00
Jeong, YunWon 2b19ba79a8 Align bytecode CFG cleanup with CPython (#7781) 2026-05-12 22:14:24 +09:00
Shahar Naveh 8fe23b8a15 Update test_peepholer.py to 3.14.5 (#7864) 2026-05-12 20:56:36 +09:00
Shahar Naveh ff05dae11c Update pydoc_data to 3.14.5 (#7863) 2026-05-12 20:54:51 +09:00
Shahar Naveh 1da29ff003 Update typing.py to 3.14.5 (#7862) 2026-05-12 20:54:36 +09:00
Shahar Naveh a702e9ccc7 Update test_functools.py to 3.14.5 (#7861) 2026-05-12 20:54:18 +09:00
Shahar Naveh 9ee27526bc Update encodings to 3.14.5 (#7859) 2026-05-12 20:54:11 +09:00
Shahar Naveh fb37b5ecc6 Update test_marshal.py to 3.14.5 (#7865)
* Update `test_marshal.py` to 3.14.5

* mark failing tests
2026-05-12 20:53:54 +09:00
Shahar Naveh 3bfa5ab8c0 Update dataclasses.py to 3.14.5 (#7857) 2026-05-12 20:53:35 +09:00
Shahar Naveh a0632ae2c5 Update inspect.py to 3.14.5 (#7854) 2026-05-12 20:53:24 +09:00
Shahar Naveh f3c2198ff0 Update timeit.py to 3.14.5 (#7852) 2026-05-12 20:53:11 +09:00
Shahar Naveh 2bcbe96e6d Update test_calendar.py to 3.14.5 (#7848) 2026-05-12 20:53:03 +09:00
Shahar Naveh f5357692e8 Update test_type_comments.py to 3.14.5 (#7858) 2026-05-12 20:52:52 +09:00
Shahar Naveh e0689bad7c Update urllib to 3.14.5 (#7856) 2026-05-12 20:52:36 +09:00
Shahar Naveh 1ac55db966 Update test_warnings to 3.14.5 (#7853) 2026-05-12 20:52:20 +09:00
Shahar Naveh a7c9b98b5a Update test_fileinput.py to 3.14.5 (#7851) 2026-05-12 20:52:08 +09:00
Shahar Naveh 2bb7dd8cf9 Update smtplib.py to 3.14.5 (#7850) 2026-05-12 20:51:57 +09:00
Shahar Naveh f6c382c595 Update runpy.py to 3.14.5 (#7849) 2026-05-12 20:51:46 +09:00
Shahar Naveh 72679af4b2 Update re related tests (#7847) 2026-05-12 20:51:33 +09:00
Shahar Naveh 27db8e5847 Update test_os.py to 3.14.5 (#7846)
* Update `test_os.py` to 3.14.5

* Mark failing test

* fix typo
2026-05-12 20:51:19 +09:00
Shahar Naveh 68be554684 Update pty.py to 3.14.5 (#7845) 2026-05-12 20:51:02 +09:00