-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-80334: fix multiprocessing.freeze_support for other spawn platforms #134462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <[email protected]> Co-authored-by: Gregory P. Smith <[email protected]>
…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 <[email protected]> Co-authored-by: Gregory P. Smith <[email protected]>
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 <[email protected]> Co-authored-by: Gregory P. Smith <[email protected]>
…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 <[email protected]> Co-authored-by: Gregory P. Smith <[email protected]>
|
… 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. |
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