14 Commits
Author SHA1 Message Date
youknowdotandCodex dc8ea56566 Update 16 stdlib test modules from CPython 3.15 (#9411)
* Update 16 stdlib test modules from CPython 3.15

Sync with scripts/update_lib migrate from CPython d220409a13b77de7a6c30abe16ea90db01528edc, preserving existing RustPython markers.

Assisted-by: Codex:GPT-6.1

* Limit SEND completion tracing to generators and coroutines

Match CPython INSTRUMENTED_END_SEND receiver semantics: other awaitables returning values must not synthesize caller StopIteration trace events. Preserve actual exceptions, builtin generator/coroutine completion and trampoline paths.

Assisted-by: Codex:GPT-6.1

---------

Co-authored-by: Codex <codex@openai.com>
2026-10-28 17:29:13 +09:00
Jeong, YunWon 5afe140abd Store ContextVar.name as the original str object (#8682)
* Store ContextVar.name as the original str object

Keep the constructor argument instead of converting it to a Rust String
so lone surrogates and str subclasses are preserved. Build __repr__
from the name and default reprs.

Assisted-by: Grok:4.6

* Compare Context objects by their variable maps

Implement Context ==/!= from the mapping contents and mark Context
unhashable. Snapshot the map before value equality so re-entrant
ContextVar.set during __eq__ cannot deadlock.

Enable test_context.ContextTest.test_context_run_4.

Assisted-by: Grok:4.6
2026-09-10 13:46:20 +09:00
Jeong, YunWon eee9ad6420 Align contextvars, CLI startup, and stat validation with CPython (#8657)
* Align contextvars, CLI startup, and stat validation with CPython

Validate Context and ContextVar arguments and mapping keys, hash names through the Python protocol, and preserve string contents without invoking __str__. Set the main module loader for command and stdin execution, report missing scripts with exit status 2, and reject file descriptors combined with follow_symlinks=False.

Enable the nine corresponding stdlib regression tests.

Assisted-by: Codex:gpt-6

* Move set_main_builtin_importer off the compiler feature

Define the method in vm_new.rs so builds without rustpython-compiler,
such as example_projects/barebone, can compile. Also set BuiltinImporter
on an existing __main__ when its loader is missing or None.

Assisted-by: Grok:4.6
2026-09-06 23:54:30 +09:00
Jeong, YunWon 25b5dfe5ca Fix /dev/fd, rlimit, spawn scheduler, and context cache (#8651)
* Fix /dev/fd, rlimit, spawn scheduler, and context cache

Honor PYTHONEXECUTABLE when computing sys.executable.
Rewind the file offset after a pyc magic probe.
Stop masking rlimit values with RLIM_INFINITY.
Print the pyrepl-unavailable warning before the rustyline shell.
Parse posix_spawn scheduler and apply it where the host supports it.
Update ContextVar cache fields under one lock.
Remove expectedFailure and skip markers for tests that now pass.

Assisted-by: Grok:4.6

* address review: check rlim_t overflow on convert

Replace the u64-to-rlim_t as-cast in py2rlim_limit with
a checked try_from, matching py2rlim.

Assisted-by: Grok:4.6
2026-09-05 17:57:29 +09:00
Shahar Naveh b739b659f0 Update test_context.py to 3.14.4 (#7804)
* Update `test_context.py` to 3.14.4

* Mark & fix some tests

* clippy
2026-05-10 00:28:30 +09:00
Jeong, YunWon efce325cbf Fix asyncio related compiler/library issues (#6837)
* Fix socket bytes support

* fix unwind_fblock

* fix posix.sendfile

* fix ssl_write

* Fix SSL ZeroReturn

* fix context

* fix generator

* Enable unittest test_async_case again
2026-01-23 19:59:29 +09:00
Terry Tianlin Luan 833f7343c8 Update email library v3.13.11 (#6642)
* Updated the email library + added test suite

* Added Windows altzone + Fixed memory error in `bytes_inner.rs`
2026-01-17 18:15:35 +09:00
Terry Tianlin LuanandJeong, YunWon 609dbb1439 Downgraded skips in tests (#6716)
* Downgraded skips in tests

* Fixed failing tests

* Fixed test_ftplib + test_socket + test_ssl + test_threaded_import failures

* Removed comments about which tests are run in which environment

* Addressed PR comments

* Annotated skips on failing tests

* Removed unneeded tests

* Removed unneeded sys import from test_ftplib

* Added annotation to test_ftplib

* Readded skipIf to test_cleanup_with_symlink_modes with a more general ENV_POLLUTING_TESTS_WINDOWS

* Addressed PR comments

* Made changes to minimize diff in PR

* Apply suggestion from @youknowone

---------

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
2026-01-15 21:43:22 +09:00
Jeong YunWon 63c3f31c99 skip flaky test in test_context 2024-05-17 14:02:40 +09:00
Jeong YunWon e5bf72e897 contextvars 2024-05-07 22:43:21 +09:00
NakanoMiku b93199f007 Update test_context.py from CPython v3.12.0 2023-11-30 20:11:24 +08:00
Andrey Maltsev 2a41320963 Update test_context from Cpython v3.11.2 2023-04-02 13:10:36 +00:00
Padraic Fanning 1231bfb756 Mark failing/erroring tests 2022-01-29 20:17:36 -05:00
Padraic Fanning 4f979a3edf Add test_context from CPython 3.8 2022-01-29 20:17:35 -05:00