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 Felipe A. Hernandez
Recipients Felipe A. Hernandez, davin, giampaolo.rodola, pitrou
Date 2020-07-09.20:10:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
import traceback
import multiprocessing.managers

class MyManager(multiprocessing.managers.SyncManager):

class DictList(multiprocessing.managers.BaseProxy):
    _method_to_typeid_ = {'__getitem__': 'dict'}

    def __getitem__(self, key):
        return self._callmethod('__getitem__', (key,))

MyManager.register('DictList', None, DictList)

with MyManager() as manager:

    nested = manager.DictList([{'hello': 'world'}])
    print(nested[0]['hello'])  # world

    proxy = manager.list([nested])
    except AttributeError:
        Bug: AttributeError: ProxyBase._callmethod is None

        This error is raised because proxies returned as #RETURN messages
        have no manager reference, which is required to resolve typeids
        (using BaseManager._registry).

        Only proxies returned as #PROXY messages will be fully functional.

        This is an undocumented current implementation limitation.

        Fix (proposal)

        Include the manager class (not the instance) as part of the proxy
        serialization in BaseProxy.__reduce__, as BaseManager._registry is
        a class variable.

        Note: #PROXY message protocol can be also replaced by regular proxy
              serialization after this fix, resulting on simpler codebase.
Date User Action Args
2020-07-09 20:10:20Felipe A. Hernandezsetrecipients: + Felipe A. Hernandez, pitrou, giampaolo.rodola, davin
2020-07-09 20:10:20Felipe A. Hernandezsetmessageid: <>
2020-07-09 20:10:20Felipe A. Hernandezlinkissue35919 messages
2020-07-09 20:10:20Felipe A. Hernandezcreate