This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mbussonn
Recipients mbussonn
Date 2020-06-19.21:00:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1592600405.92.0.621654131969.issue41041@roundup.psfhosted.org>
In-reply-to
Content
$ python
Python 3.8.2 | packaged by conda-forge | (default, Apr 24 2020, 07:56:27)
[Clang 9.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing import Pool
>>>
>>> def f(x):
...     return x*x
...
 
>>> with Pool(5) as p:
...     print(p.map(f, [1, 2, 3]))
Process SpawnPoolWorker-1:
Process SpawnPoolWorker-2:
Process SpawnPoolWorker-3:
Traceback (most recent call last):
  File "/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/pool.py", line 114, in worker
    task = get()
  File "/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/queues.py", line 358, in get
    return _ForkingPickler.loads(res)
AttributeError: Can't get attribute 'f' on <module '__main__' (built-in)>
Traceback (most recent call last):
...

This is likely due to https://bugs.python.org/issue33725 (use spawn on MacOS), we we can't use `fork()`.
History
Date User Action Args
2020-06-19 21:00:05mbussonnsetrecipients: + mbussonn
2020-06-19 21:00:05mbussonnsetmessageid: <1592600405.92.0.621654131969.issue41041@roundup.psfhosted.org>
2020-06-19 21:00:05mbussonnlinkissue41041 messages
2020-06-19 21:00:05mbussonncreate