]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 8 Oct 2025 00:37:30 +0000 (02:37 +0200)
committerGitHub <noreply@github.com>
Wed, 8 Oct 2025 00:37:30 +0000 (00:37 +0000)
commit6b26e62f376097a0e4db315b660cbdc40646efb0
tree4f597a8a79dad6f1c9a68e9f8b595a1af95c03e7
parent64f0e2d6fac3729ea1bc7ea3a07934e8b486d608
[3.14] gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814) (#139084)

gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814)

* gh-138813: Default `BaseProcess` `kwargs` to `None` (GH-138814)

Set `BaseProcess.__init__(..., kwargs=None)` and initialize `kwargs` with
`dict(kwargs) if kwargs else {}`. This avoids a shared mutable default and
matches threading.Thread behavior.

* DummyProcess kwargs=None (which threading.Thread accepts properly)
(cherry picked from commit 5a15e7378996358848394930343e9633b6fec8a9)

Co-authored-by: Denis Sergeev <newjimbatler00@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Lib/multiprocessing/dummy/__init__.py
Lib/multiprocessing/process.py
Lib/test/_test_multiprocessing.py
Misc/NEWS.d/next/Library/2025-09-17-08-32-43.gh-issue-138813.LHkHjX.rst [new file with mode: 0644]