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 Santiago Hernandez
Recipients Santiago Hernandez
Date 2018-07-03.18:06:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1530641186.32.0.56676864532.issue34034@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

I am splitting some processing among different processes with the forkserver start method using multiprocessing.
In python 3.4 to 3.6 this worked fine.
In python 3.7.0 it's breaking with the following Traceback:

```
  File "/data/venvs/py37/Python-3.7.0/lib/python3.7/multiprocessing/process.py", line 112, in start
    self._popen = self._Popen(self)
  File "/data/venvs/py37/Python-3.7.0/lib/python3.7/multiprocessing/context.py", line 223, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/data/venvs/py37/Python-3.7.0/lib/python3.7/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/data/venvs/py37/Python-3.7.0/lib/python3.7/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/data/venvs/py37/Python-3.7.0/lib/python3.7/multiprocessing/popen_fork.py", line 20, in __init__
    self._launch(process_obj)
  File "/data/venvs/py37/Python-3.7.0/lib/python3.7/multiprocessing/popen_spawn_posix.py", line 47, in _launch
    reduction.dump(process_obj, fp)
  File "/data/venvs/py37/Python-3.7.0/lib/python3.7/multiprocessing/reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle weakref objects
```

I am attaching a minimum example where this happens.
In the example this can be solved by making self._run_single a staticmethod.

However, I would like to understand what is going on and what changed in python for this to throw an exception now, when before it did not.

Thanks.
Santiago
History
Date User Action Args
2018-07-03 18:06:26Santiago Hernandezsetrecipients: + Santiago Hernandez
2018-07-03 18:06:26Santiago Hernandezsetmessageid: <1530641186.32.0.56676864532.issue34034@psf.upfronthosting.co.za>
2018-07-03 18:06:26Santiago Hernandezlinkissue34034 messages
2018-07-03 18:06:26Santiago Hernandezcreate