]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProc...
authorDenis Sergeev <newjimbatler00@gmail.com>
Wed, 17 Sep 2025 21:45:52 +0000 (00:45 +0300)
committerGitHub <noreply@github.com>
Wed, 17 Sep 2025 21:45:52 +0000 (14:45 -0700)
commit5a15e7378996358848394930343e9633b6fec8a9
tree39998e3a4302faca6887361c535b47eb9082f3b4
parentb42af37ceddd05ffba6f561b1b534e93a4ad2505
gh-138813: Fix mutable default kwargs={} in multiprocessing BaseProcess and DummyProcess to use None (GH-138814)

* gh-138813: Default `BaseProcess` `kwargs` to `None` (#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.

Co-authored-by: Dmitrii Chuprov <cheese@altlinux.org>
* DummyProcess kwargs=None (which threading.Thread accepts properly)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
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]