]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-100228: Warn from os.fork() if other threads exist. (#100229)
authorGregory P. Smith <greg@krypto.org>
Thu, 29 Dec 2022 22:41:39 +0000 (14:41 -0800)
committerGitHub <noreply@github.com>
Thu, 29 Dec 2022 22:41:39 +0000 (14:41 -0800)
commit894f2c3c161933bd820ad322b3b678d89bc2377c
tree9c41c6fe2ce16ab42d7fc35223eeca1c061ea269
parent2df82db48506e5a2044a28f147fdb42f662d37b9
gh-100228: Warn from os.fork() if other threads exist. (#100229)

Not comprehensive, best effort warning. There are cases when threads exist on some platforms that this code cannot detect. macOS when API permissions allow and Linux with a readable /proc procfs present are the currently supported cases where a warning should show up reliably.

Starting with a DeprecationWarning for now, it is less disruptive than something like RuntimeWarning and most likely to only be seen in people's CI tests - a good place to start with this messaging.
12 files changed:
Include/internal/pycore_global_objects_fini_generated.h
Include/internal/pycore_global_strings.h
Include/internal/pycore_runtime_init_generated.h
Include/internal/pycore_unicodeobject_generated.h
Lib/test/fork_wait.py
Lib/test/test_os.py
Lib/test/test_thread.py
Lib/test/test_threading.py
Lib/threading.py
Misc/NEWS.d/next/Library/2022-12-13-17-29-09.gh-issue-100228.bgtzMV.rst [new file with mode: 0644]
Modules/_testcapimodule.c
Modules/posixmodule.c