Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Checklist
- I am confident this is a bug in CPython, not a bug in a third-party project
- I have searched theCPython issue tracker,
and am confident this bug has not been reported before
CPython versions tested on:
3.10
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.10.12 (main, Jul 5 2023, 18:54:27) [GCC 11.2.0]
A clear and concise description of the bug:
The code forset_forkserver_preload (also in the latestmain branch) should check the type of the elements passed through themodule_names parameter, but instead checks the elements ofself._preload_modules.
Code for reproducing:
#!/usr/bin/env python3importmultiprocessingasmpimporttimedefwork(param):print("work")if__name__=='__main__':ctx=mp.get_context('forkserver')ctx.set_forkserver_preload(['time',1])withctx.Pool(2)asp:p.map(work, [0,1,2,3 ])
Raises error:
Traceback (most recent call last): File "<string>", line 1, in <module> File ".../lib/python3.10/multiprocessing/forkserver.py", line 178, in main __import__(modname)TypeError: __import__() argument 1 must be str, not int