]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-135427: Fix DeprecationWarning for os.fork when run in threads with -Werror (GH...
authorRani Pinchuk <33353578+rani-pinchuk@users.noreply.github.com>
Tue, 26 Aug 2025 13:33:21 +0000 (15:33 +0200)
committerGitHub <noreply@github.com>
Tue, 26 Aug 2025 13:33:21 +0000 (15:33 +0200)
commitfd8f42d3d1038a812340c3ec3cbfc995a80c4e13
tree652db2e17e1b1bdcda0fc12563229051913d916b
parentf60f8225ed146a8f9b5fbf1eeed3474782127ea8
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.
27 files changed:
Lib/test/_test_multiprocessing.py
Lib/test/support/warnings_helper.py
Lib/test/test_asyncio/test_unix_events.py
Lib/test/test_builtin.py
Lib/test/test_concurrent_futures/executor.py
Lib/test/test_concurrent_futures/test_as_completed.py
Lib/test/test_concurrent_futures/test_deadlock.py
Lib/test/test_concurrent_futures/test_init.py
Lib/test/test_concurrent_futures/test_process_pool.py
Lib/test/test_concurrent_futures/test_shutdown.py
Lib/test/test_concurrent_futures/test_thread_pool.py
Lib/test/test_concurrent_futures/test_wait.py
Lib/test/test_concurrent_futures/util.py
Lib/test/test_fork1.py
Lib/test/test_kqueue.py
Lib/test/test_logging.py
Lib/test/test_mailbox.py
Lib/test/test_os.py
Lib/test/test_platform.py
Lib/test/test_pty.py
Lib/test/test_random.py
Lib/test/test_socketserver.py
Lib/test/test_support.py
Lib/test/test_tracemalloc.py
Lib/test/test_uuid.py
Misc/NEWS.d/next/Library/2025-07-19-11-53-19.gh-issue-135427.iJM_X2.rst [new file with mode: 0644]
Modules/posixmodule.c