SIGN IN SIGN UP

[3.12] gh-104690 Disallow thread creation and fork at interpreter finalization (GH-104826) (#105277)

gh-104690 Disallow thread creation and fork at interpreter finalization (GH-104826)

Disallow thread creation and fork at interpreter finalization.

in the following functions, check if interpreter is finalizing and raise `RuntimeError` with appropriate message:
* `_thread.start_new_thread` and thus `threading`
* `posix.fork`
* `posix.fork1`
* `posix.forkpty`
* `_posixsubprocess.fork_exec` when a `preexec_fn=` is supplied.

---------

(cherry picked from commit ce558e69d4087dd3653207de78345fbb8a2c7835)

Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
M
Miss Islington (bot) committed
c7a9d96a25a646d37cb97506019e82ee7493d1b3
Parent: f629d5f
Committed by GitHub <noreply@github.com> on 6/4/2023, 4:32:00 AM