0

This seems to be a python 3.6 bug

When assigning a manager.Queue to a manager.Namespace attribute one gets an TypeError. To reproduce it is simple:

>>> from multiprocessing import Manager
>>> manager = Manager()
>>> np = manager.Namespace()
>>> np.shared_queue = manager.Queue()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\users\leonardo.schettini\appdata\local\programs\python\python36-32\Lib\multiprocessing\managers.py", line 1065, in __setattr__
    return callmethod('__setattr__', (key, value))
File "c:\users\leonardo.schettini\appdata\local\programs\python\python36-32\Lib\multiprocessing\managers.py", line 772, in _callmethod
    raise convert_to_error(kind, result)
multiprocessing.managers.RemoteError:
---------------------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\leonardo.schettini\appdata\local\programs\python\python36-32\Lib\multiprocessing\managers.py", line 228, in serve_client
    request = recv()
File "c:\users\leonardo.schettini\appdata\local\programs\python\python36-32\Lib\multiprocessing\connection.py", line 251, in recv
    return _ForkingPickler.loads(buf.getbuffer())
File "c:\users\leonardo.schettini\appdata\local\programs\python\python36-32\Lib\multiprocessing\managers.py", line 881, in RebuildProxy
    return func(token, serializer, incref=incref, **kwds)
TypeError: AutoProxy() got an unexpected keyword argument 'manager_owned'
---------------------------------------------------------------------------

Here, I found that manager.Queue is just

an address (proxy) pointing to shared queue managed by the multiprocessing.Manager() object

If one tries to assign a multiprocessing.Queue instead a RuntimeError is raised. This makes sense if you consider that the multiprocessing.Queue can't be pickled (information on provided link)

leoschet
  • 1,697
  • 17
  • 33
  • 1
    I am not able to reproduce the error on Ubuntu. So either this is an installation error on your particular computer, or this is a Windows related error. – Hannu May 24 '18 at 15:43
  • Probably Ruindows error then. I also found [this](https://bugs.python.org/issue30256) – leoschet May 24 '18 at 16:02
  • It could be a 3.6 bug, then. My test was with 3.5 (and it also works on 2.7). I do not have 3.6 anywhere for testing. – Hannu May 24 '18 at 16:05
  • 1
    Just out of curiosity I installed 3.6.5 on a virtual machine (ubuntu), and the error appears. So this is a 3.6 bug or feature. – Hannu May 24 '18 at 16:10

0 Answers0