Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2022-02-11.14:57:09.587>labels= ['type-feature', 'library', '3.9', '3.10', '3.11']
title='Add support for path-like objects to multiprocessing.set_executable for Windows to be on a par with Unix-like systems'updated_at=<Date2022-02-11.22:25:00.201>user='https://github.com/maggyero'
This is because the ‘fork’ start method does not exec any program in the subprocess, the ‘spawn’ start method converts its path argument to bytes with os.fsencode before passing to _posixsubprocess.fork_exec, and the ‘forkserver’ start method spawns a server process (like with the ‘spawn’ start method) which then forks itself at each request (like the ‘fork’ start method):
Linux (and other Unix-like systems) uses the same code than MacOS for the three start methods so it should work for it too.
However I have not tested this on Windows which uses the function _winapi.CreateProcess for the ‘spawn’ start method (the only start method available on this OS) but I noticed that no conversion to str (not to bytes this time, since the function expects str) of the path argument with os.fsdecode (not os.fsencode this time) is performed before passing it to the function:
So on Windows only str path can be passed to multiprocessing.set_executable. This PR fixes this to be on a par with Unix-like systems which accept any path-like objects.
maggyeromannequin
changed the title
Add support of path-like objects to multiprocessing.set_executable for Windows to match Unix-like systems
Add support for path-like objects to multiprocessing.set_executable for Windows to be on a par with Unix-like systems
Feb 11, 2022
maggyeromannequin
changed the title
Add support of path-like objects to multiprocessing.set_executable for Windows to match Unix-like systems
Add support for path-like objects to multiprocessing.set_executable for Windows to be on a par with Unix-like systems
Feb 11, 2022
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: