[New-bugs-announce] [issue20854] multiprocessing.managers.Server: problem with returning proxy of registered object

Allis Tauri report at bugs.python.org
Wed Mar 5 17:03:30 CET 2014


New submission from Allis Tauri:

1. I have a tree-like recursive class MyClass. It's method 'get_child(i)' returns an instanse of that same class.
2. I register this class with BaseManager as follows:

class MyManager(BaseManager): pass
MyManager.register('MyClass', MyClass, method_to_typeid={'get_child':'MyClass'})

3. When I call 'get_child' method of AutoProxy[MyClass] object, the exception is raised in the '__init__' method of MyClass: it is called with a single argument which is the instance of MyClass returned by 'get_child'. This happens in the following code of multiprocessing.managers.Server.create method:

373 def create(self, c, typeid, *args, **kwds):
...
382         if callable is None:
383             assert len(args) == 1 and not kwds
384             obj = args[0]
385         else:
386             obj = callable(*args, **kwds) <-This line raises the exception

This means that if ANY method registered with a Manager should return a proxy for a registered typeid, for which a callable is provided, it will fail, unless the callable is capable to handle such unexpected arguments.

----------
components: Library (Lib)
messages: 212763
nosy: allista
priority: normal
severity: normal
status: open
title: multiprocessing.managers.Server: problem with returning proxy of registered object
versions: Python 2.7, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20854>
_______________________________________


More information about the New-bugs-announce mailing list