gh-80334: fix multiprocessing.freeze_support for other spawn platforms#134462
gh-80334: fix multiprocessing.freeze_support for other spawn platforms#134462gpshead merged 5 commits intopython:mainfrom
Conversation
…ge to specify spawn method instead of platform
…, not just win32.
|
reading things over, i'm convinced you are correct that this needs to not just use a win32 check. i moved my #134617 changes over into this PR. |
…atforms (pythonGH-134462) Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform Have multiprocessing.freeze_support() enable on spawn, not just win32. --------- (cherry picked from commit 80284b5) Co-authored-by: Eddy Mulyono <eddymul@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
…atforms (pythonGH-134462) Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform Have multiprocessing.freeze_support() enable on spawn, not just win32. --------- (cherry picked from commit 80284b5) Co-authored-by: Eddy Mulyono <eddymul@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
GH-134619 is a backport of this pull request to the 3.14 branch. |
|
GH-134620 is a backport of this pull request to the 3.13 branch. |
…latforms (GH-134462) (#134620) gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462) Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform Have multiprocessing.freeze_support() enable on spawn, not just win32. --------- (cherry picked from commit 80284b5) Co-authored-by: Eddy Mulyono <eddymul@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
…latforms (GH-134462) (#134619) gh-80334: fix multiprocessing.freeze_support for other spawn platforms (GH-134462) Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform Have multiprocessing.freeze_support() enable on spawn, not just win32. --------- (cherry picked from commit 80284b5) Co-authored-by: Eddy Mulyono <eddymul@gmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
… other spawn platforms (pythonGH-134462) (python#134619)" This reverts commit 00fd544.
|
This patch breaks set_start_method for use in Python (not frozen) and also breaks it for cx_Freeze. import multiprocessing
def foo(q):
q.put("Hello from cx_Freeze")
if __name__ == "__main__":
multiprocessing.freeze_support()
multiprocessing.set_start_method('spawn')
q = multiprocessing.SimpleQueue()
p = multiprocessing.Process(target=foo, args=(q,))
p.start()
print(q.get())
p.join()This sample worked before in windows and linux for python 3.9 until python 3.13.3. I suspect that a correct fix is change the line 148 from: |
|
@marcelotduarte Please make a new issue so we can track this. |
…atforms (pythonGH-134462) Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform Have multiprocessing.freeze_support() enable on spawn, not just win32. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
…atforms (pythonGH-134462) Doc/library/multiprocessing.rst: freeze_support: Change to specify spawn method instead of platform Have multiprocessing.freeze_support() enable on spawn, not just win32. --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
multiprocessing.freeze_support() now checks for work on any "spawn"
start method platform rather than only on Windows.
📚 Documentation preview 📚: https://cpython-previews--134462.org.readthedocs.build/en/134462/library/multiprocessing.html#multiprocessing.freeze_support