-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed as not planned
Closed as not planned
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import multiprocessing
multiprocessing.Pool(None, lambda: None)This works in Python versions up to 3.13.9, but fails in 3.14.0:
AttributeError: module '__main__' has no attribute '<lambda>'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/bgilbert/tmp/t/pool.py", line 2, in <module>
multiprocessing.Pool(None, lambda: None)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/multiprocessing/context.py", line 119, in Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
context=self.get_context())
File "/usr/lib64/python3.14/multiprocessing/pool.py", line 215, in __init__
self._repopulate_pool()
~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/lib64/python3.14/multiprocessing/pool.py", line 306, in _repopulate_pool
return self._repopulate_pool_static(self._ctx, self.Process,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
self._processes,
^^^^^^^^^^^^^^^^
...<3 lines>...
self._maxtasksperchild,
^^^^^^^^^^^^^^^^^^^^^^^
self._wrap_exception)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/multiprocessing/pool.py", line 329, in _repopulate_pool_static
w.start()
~~~~~~~^^
File "/usr/lib64/python3.14/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
~~~~~~~~~~~^^^^^^
File "/usr/lib64/python3.14/multiprocessing/context.py", line 300, in _Popen
return Popen(process_obj)
File "/usr/lib64/python3.14/multiprocessing/popen_forkserver.py", line 35, in __init__
super().__init__(process_obj)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/lib64/python3.14/multiprocessing/popen_fork.py", line 20, in __init__
self._launch(process_obj)
~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/lib64/python3.14/multiprocessing/popen_forkserver.py", line 47, in _launch
reduction.dump(process_obj, buf)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.14/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
_pickle.PicklingError: Can't pickle <function <lambda> at 0x7ff55732b480>: it's not found as __main__.<lambda>
when serializing tuple item 2
when serializing dict item '_args'
when serializing multiprocessing.context.ForkServerProcess state
when serializing multiprocessing.context.ForkServerProcess objectCPython versions tested on:
3.14
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error