from billiard import get_context
def main():
ctx = get_context('spawn')
p = ctx.Process(target=task_from_process, args=('opa',))
p.start()
p.join()
return p.exitcode
def task_from_process(name:str):
print('proc:', name)
if __name__ == '__main__':
main()
console output:
$ python billiard_spawn.py
Traceback (most recent call last):
File "billiard_spawn.py", line 16, in <module>
main()
File "billiard_spawn.py", line 8, in main
p.start()
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/process.py", line 124, in start
self._popen = self._Popen(self)
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/context.py", line 341, in _Popen
return Popen(process_obj)
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/popen_spawn_posix.py", line 39, in __init__
super(Popen, self).__init__(process_obj)
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/popen_fork.py", line 24, in __init__
self._launch(process_obj)
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/popen_spawn_posix.py", line 49, in _launch
tracker_fd = semaphore_tracker.getfd()
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/semaphore_tracker.py", line 38, in getfd
self.ensure_running()
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/semaphore_tracker.py", line 62, in ensure_running
spawnv_passfds(exe, args, fds_to_pass)
File "/home/pyenv/versions/remains/lib/python3.6/site-packages/billiard/compat.py", line 226, in spawnv_passfds
False, False, None)
TypeError: fork_exec() argument 4 must be tuple, not list
Python 3.6.4 billiard.VERSION = (3, 5, 0, 3) file billiard_spawn.py
console output: