Commit Graph

612 Commits

Author SHA1 Message Date
Steve Dower ae0d2875bc gh-145035: Allows removing the _pyrepl module to completely disable the modern REPL (GH-145159) 2026-03-10 14:58:32 +01:00
Filipe Laíns 3ab39d2308 GH-145273: warn when we can't find the standard library (#145274) 2026-03-02 18:51:45 +00:00
Victor Stinner 0bbdb4e897 gh-141510: Replace MappingProxyType with frozendict (#144904) 2026-02-18 20:23:49 +00:00
Hugo van Kemenade 81484c5629 gh-144639: Ruff: target Python 3.14 syntax in Lib/test (#144656)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2026-02-11 14:12:31 +00:00
Victor Stinner b121dc4347 gh-144652: Support Windows exit status in support get_signal_name() (#144653)
Format Windows exit status as hexadecimal.
2026-02-10 12:15:14 +01:00
Steve Dower a9b6788ae6 gh-144278: Enable overriding sys.implementation's name and cache_tag when building sysmodule.c (GH-144293)
Changing the values requires forking and patching, which is intentional. Simply rebuilding from source does not change the implementation enough to justify changing these values - they would still be `cpython` and compatible with existing `.pyc` files. But people who maintain forks are better served by being able to easily override these values in a place that can be forward-ported reliably.
2026-02-10 00:01:17 +00:00
Sam Gross a01694dacd gh-120321: Make gi_yieldfrom thread-safe in free-threading build (#144292)
Add a FRAME_SUSPENDED_YIELD_FROM_LOCKED state that acts as a brief
lock, preventing other threads from transitioning the frame state
while gen_getyieldfrom reads the yield-from object off the stack.
2026-01-30 12:20:27 -05:00
Sam Gross 6ea3f8cd7f gh-144289: Remove ENABLE_SPECIALIZATION_FT (gh-144290)
Now that the specializing interpreter works with free threading,
replace ENABLE_SPECIALIZATION_FT with ENABLE_SPECIALIZATION and
replace requires_specialization_ft with requires_specialization.

Also limit the uniquely referenced check to FOR_ITER_RANGE. It's not
necessary for FOR_ITER_GEN and would cause test_for_iter_gen to fail.
2026-01-27 17:52:50 -05:00
Seth Michael Larson f7fceed79c gh-143916: Reject control characters in wsgiref.headers.Headers (GH-143917)
* Add 'test.support' fixture for C0 control characters
* gh-143916: Reject control characters in wsgiref.headers.Headers
2026-01-17 09:46:21 -08:00
Russell Keith-Magee 1857a40807 gh-143460: Correct unlimited stack size skip for Emscripten (#143765)
Modifies the test skip for unlimited stack size to add Emscripten to the
exclusion list.
2026-01-14 06:03:04 +08:00
Jeong, YunWon e7f5ffa0de gh-143641: Make ready_to_import always remove tempdir from sys.path (#143642)
Make ready_to_import always remove tempdir from sys.path
2026-01-10 12:51:42 +03:00
Jan André Reuter 61e036691c gh-143460: Skip infinite recusion tests for infinite stack size (#143606)
Avoid tests being killed due to OOM on Linux if a system is configured with
'ulimit -s unlimited' by skipping tests relying on infinite recursion.

While unclear if Python should support 'ulimit -s unlimited', we should at
least try to avoid failing a PGO build running tests due to an unlimited
stack size being set.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
2026-01-09 16:11:37 +00:00
Serhiy Storchaka c07e5ec0a9 gh-143553: Add support for parametrized resources in regrtests (GH-143554)
For example, "-u xpickle=2.7" will run test_xpickle only against Python 2.7.
2026-01-08 13:51:38 +02:00
Pablo Galindo Salgado 6658e2cb07 gh-138122: Add --subprocesses flag to profile child processes in tachyon (#142636) 2025-12-15 12:11:40 +00:00
Bartosz Sławecki f564654bae gh-142353: Isolate tests from personal GNU Readline init files (#142370)
Isolate tests from personal Readline init files using `INPUTRC=/dev/null` trick.

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-12-12 15:42:38 +01:00
Petr Viktorin 75a1cbdd38 gh-140748: socket_helper.transient_internet: Unwrap UrlError.__cause__ (GH-140749) 2025-10-30 12:14:17 +01:00
Russell Keith-Magee 9f8d005d29 gh-140702: Add test skip for Unix Datagram tests on iOS when on Github Actions (#140740)
Exposes the GITHUB_ACTIONS environment variable to iOS simulator test runs, and
uses this variable to skip a Unix Datagram socketserver test that is unreliable
in the iOS GitHub Actions environment.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-10-29 08:33:04 +00:00
Bénédikt Tran 41712c4e09 gh-139310: skip test_aead_aes_gcm for Linux kernel between 6.16.0 and 6.17.x (#139552)
Currently, Fedora 42 uses a custom Linux Kernel 6.16.9 that backported an upstream change
from 6.17-rc7 [1,3] but not its subsequent fix [2]. Until the issue is resolved upstream,
we skip the failing test `test_socket.test_aead_aes_gcm` for kernel versions between 6.16
and 6.17.x.

[1] https://github.com/torvalds/linux/commit/1b34cbbf4f011a121ef7b2d7d6e6920a036d5285
[2] https://github.com/torvalds/linux/commit/d0ca0df179c4b21e2a6c4a4fb637aa8fa14575cb.
[3] https://gitlab.com/cki-project/kernel-ark/-/commit/45bcf60fe49b37daab1acee57b27211ad1574042
2025-10-05 10:27:16 +02:00
Petr Viktorin 5df6a568e1 gh-107862: Add property-based round-trip tests for base64 (#119406)
* Add property-based tests to test_base64

* Allow multiple positional arguments in @hypothesis.example stub

* Simplify the altchars strategy
2025-09-17 13:40:35 +00:00
yihong 8ef7735c53 gh-128636: Fix crash in PyREPL when os.environ is overwritten with an invalid value for macOS (GH-138089)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-09-15 18:26:23 +02:00
Bénédikt Tran d6d054853d gh-137371: refactor and fortify test.support.hashlib_helper (#137375) 2025-09-10 09:14:38 +02:00
Rani Pinchuk fd8f42d3d1 gh-135427: Fix DeprecationWarning for os.fork when run in threads with -Werror (GH-136796)
Don't ignore errors raised by `PyErr_WarnFormat` in `warn_about_fork_with_threads`
Instead, ignore the warnings in all test code that forks. (That's a lot of functions.)

In `test_support`, make `ignore_warnings` a context manager (as well as decorator),
and add a `message` argument to it.
Also add a `ignore_fork_in_thread_deprecation_warnings` helper for the deadlock-in-fork
warning.
2025-08-26 15:33:21 +02:00
Victor Stinner 08ce7c6958 gh-129033: Remove dead code in test.support.has_no_debug_ranges() (#137379) 2025-08-04 16:48:24 +02:00
Serhiy Storchaka 1612dcbafe gh-137341: Remove more word duplications (GH-137342) 2025-08-03 19:41:12 +03:00
Jeong, YunWon 0282eef880 gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195) 2025-07-31 14:22:11 +03:00
Ani aafb1435d8 Use test.support.is_wasm32 flag for is_emscripten or is_wasi for generic checks (GH-136815)
Co-authored-by: Brett Cannon <brett@python.org>
2025-07-22 12:50:13 -07:00
Bénédikt Tran c504f62fe2 gh-136547: fix hashlib_helper for blocking and requesting digests (#136762)
- Fix `hashlib_helper.block_algorithm` where the dummy functions were incorrectly defined.
- Rename `hashlib_helper.HashAPI` to `hashlib_helper.HashInfo` and add more helper methods.
- Simplify `hashlib_helper.requires_*()` functions.
- Rewrite some private helpers in `hashlib_helper`.
- Remove `find_{builtin,openssl}_hashdigest_constructor()` as they are no more needed and were
  not meant to be public in the first place.
- Fix some tests in `test_hashlib` when FIPS mode is on.
2025-07-20 14:32:35 +02:00
Hood Chatham c730952aa6 gh-127146: Emscripten: more regular stack overflow skips (#136708)
Makes the Emscripten stack overflow skip message consistent with WASI, 
and replaces some ad-hoc skips.
2025-07-16 14:02:25 +00:00
Alper 9363703bd3 gh-116738: Make grp module thread-safe (#135434)
Make grp module methods getgrgid() and getgrnam() thread-safe when the GIL is disabled and getgrgid_r()/getgrnam_r() C APIs are not available.
---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-07-14 11:18:41 -07:00
Bénédikt Tran 9e5cebd56d gh-136547: allow to temporarily disable hash algorithms in tests (#136570) 2025-07-13 10:58:15 +02:00
sobolevn 06e347b846 gh-136285: Improve pickle protocol testing in test_interpreters (#136286) 2025-07-06 07:35:30 +00:00
Serhiy Storchaka c45f4f3ebe gh-78465: Fix error message for cls.__new__(cls, ...) where cls is not instantiable (GH-135981)
Previous error message suggested to use cls.__new__(), which
obviously does not work. Now the error message is the same as for
cls(...).
2025-06-27 14:35:55 +03:00
Nadeshiko Manju 1ddfe59320 gh-135543: Emit sys.remote_exec audit event when sys.remote_exec is called (GH-135544) 2025-06-19 21:23:38 +01:00
Eric Snow 62143736b6 gh-134939: Add the concurrent.interpreters Module (gh-133958)
PEP-734 has been accepted (for 3.14).

(FTR, I'm opposed to putting this under the concurrent package, but
doing so is the SC condition under which the module can land in 3.14.)
2025-06-11 17:35:48 -06:00
Serhiy Storchaka 6ef06fad84 gh-135120: Add test.support.subTests() (GH-135121) 2025-06-06 13:52:48 +02:00
Daniel Hollas bc00ce941e gh-135074: Fix exception messages in test.support module (GH-135076) 2025-06-04 14:58:34 +02:00
Eric Snow 52deabefd0 gh-132775: Expand the Capability of Interpreter.call() (gh-133484)
It now supports most callables, full args, and return values.
2025-05-30 09:15:00 -06:00
Eric Snow 56743afe87 gh-132775: Unrevert "Use _PyCode GetScriptXIData()" (gh-134735)
This reverts commit 8a793c4a36, AKA gh-134599.

This effectively re-applies commit 09e72cf (gh-134511)
2025-05-26 11:50:10 -06:00
Hugo van Kemenade 328a778db8 gh-134357: Remove unused imports in tests (#134340) 2025-05-25 20:09:02 +00:00
Eric Snow 8a793c4a36 gh-134557: Revert "gh-132775: Use _PyCode GetScriptXIData()" (gh-134599)
This reverts commit 09e72cf091, AKA gh-134511.

We are reverting due to refleaks on free-threaded builds.
2025-05-23 20:04:20 +00:00
Eric Snow 09e72cf091 gh-132775: Use _PyCode GetScriptXIData() (gh-134511) 2025-05-22 08:40:33 -06:00
Eric Snow d0eedfa10e gh-132775: Use _PyObject_GetXIData (With Fallback) (gh-134440)
This change includes some semi-related refactoring of queues and channels.
2025-05-22 06:50:06 -06:00
Serhiy Storchaka 2602d8ae98 gh-71339: Use new assertion methods in tests (GH-129046) 2025-05-22 13:17:22 +03:00
Yuichiro Tachibana (Tsuchiya) b1b8962443 gh-127960 Fix the REPL to set the correct namespace by setting the correct __main__ module (gh-134275)
The `__main__` module imported in the `_pyrepl` module points to the `_pyrepl` module itself when the interpreter was launched without `-m` option and didn't execute a module,
while it's an unexpected behavior that `__main__` can be `_pyrepl` and relative imports such as `from . import *` works based on the `_pyrepl` module.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-05-22 02:18:00 +02:00
Eric Snow 88f8102a8f gh-132775: Support Fallbacks in _PyObject_GetXIData() (gh-133482)
It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`.  There's also room for other fallback modes if that later makes sense.
2025-05-21 07:23:48 -06:00
Bénédikt Tran 73d71a416f gh-132388: test HACL* and OpenSSL hash functions in pure Python HMAC (#134051) 2025-05-16 14:00:01 +02:00
Jelle Zijlstra 9836503b48 gh-133701: Fix incorrect __annotations__ on TypedDict defined under PEP 563 (#133772) 2025-05-14 06:24:33 -07:00
Serhiy Storchaka 14305a83d3 gh-133677: Fix tests when running in non-UTF-8 locale (GH-133865) 2025-05-12 19:09:11 +03:00
Victor Stinner 67086282fc gh-133741: Fix _can_strace(): check --trace option (#133766)
The --trace option needs strace 5.5 or newer.
2025-05-09 18:25:47 +02:00
Emma Smith c273f59fb3 gh-132983: Add the compression.zstd pacakge and tests (#133365)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Rogdham <contact@rogdham.net>
2025-05-06 01:38:08 +01:00