-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Open
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
PR #134462 (GH-80334) breaks set_start_method for use in Python (not frozen) and also breaks it for cx_Freeze.
A simple sample using 'spaw', but also breaks with 'fork' or 'forkserver':
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.
For cx_Freeze I made a temporary fix.
I suspect that a correct fix is change the line 148 from:
if self.get_start_method() == 'spawn' and getattr(sys, 'frozen', False):
to a simple:
if getattr(sys, 'frozen', False):
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs
gpshead
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixes3.15new features, bugs and security fixesnew features, bugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error