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 allista
Recipients allista
Date 2014-03-05.16:03:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394035410.32.0.813669524051.issue20854@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-03-05 16:03:30allistasetrecipients: + allista
2014-03-05 16:03:30allistasetmessageid: <1394035410.32.0.813669524051.issue20854@psf.upfronthosting.co.za>
2014-03-05 16:03:30allistalinkissue20854 messages
2014-03-05 16:03:28allistacreate