python-2.7pyro

Pyro4 cPickle serlializer


For security reasons, Pyro4 doesn't allow using pickle serializer a runtime quick fix for that can be the following.

Pyro4.config.SERIALIZERS_ACCEPTED = set(['pickle','json', 'marshal', 'serpent'])

is it possible to set the faster pickle implementation cPickle instead ?

trying the earlier method generates this error

Pyro4.config.SERIALIZERS_ACCEPTED = set(['cPickle','pickle','json', 'marshal', 'serpent'])
Pyro4.errors.SerializeError: serializer 'cPickle' is unknown or not available

Solution

  • There's no need to be concerned about the difference between cPickle and pickle, Pyro takes care of this for you and choose the fastest implementation available. Much like Python 3.x that hasn't even got a cPickle module any more.