Stub binary doesn't support sys.executable
spawn/multiprocessing
#8
Labels
bug
A crash or error in behavior.
sys.executable
spawn/multiprocessing
#8
Describe the bug
The stub binary used to start an app is an effective replacement for the
python.exe
binary; however, it isn't a perfect replacements.multiprocessing
in spawn mode will try to invokesys.executable
to spawn a child; it's also common to usesubprocess
oros.spawn
to try and startsys.exectuable
to run other Python code as a subprocess. However, the stub binary doesn't support this kind of execution.Steps to reproduce
multiprocessing.Process()
and start it with.start()
The subprocess will call the parent process entry point, and fail.
Expected behavior
The function targeted by
Process()
should be invoked with the provided arguments.Screenshots
No response
Environment
Logs
n/a
Additional context
See beeware/briefcase-macOS-app-template#7 for an analogous report on macOS.
One possible solution would be to add some logic to the stub binary to inspect to see if the parent process is "self"; if so, the execution of the app should be modified to behave as if it were a normal Python binary.
Any solution should also be ported to macOS (beeware/briefcase-macOS-Xcode-template#20) and Linux (beeware/briefcase-linux-flatpak-template#10)
The text was updated successfully, but these errors were encountered: