autoproxy example only works with pickle

Matt Nelson <[email protected]>
Newsgroups gmane.comp.python.pyro
Message-ID <[email protected]>
The autoproxy example does not work out of the box. The server runs, but the 
client throws a traceback:

$ python client.py 
enter factory server object uri: PYRO:example.autoproxy@localhost:64340
/Users/ach/projects/pyrotest/lib/python2.7/site-packages/Pyro4/core.py:167: 
UserWarning: HMAC_KEY not set, protocol data may not be secure
  warnings.warn("HMAC_KEY not set, protocol data may not be secure")
Creating things.
Traceback (most recent call last):
  File "client.py", line 14, in <module>
    thing1 = factory.createSomething(1)
  File "/Users/ach/projects/pyrotest/lib/python2.7/site-
packages/Pyro4/core.py", line 161, in __call__
    return self.__send(self.__name, args, kwargs)
  File "/Users/ach/projects/pyrotest/lib/python2.7/site-
packages/Pyro4/core.py", line 310, in _pyroInvoke
    data=self._pyroSerializer.deserializeData(data, compressed=flags & 
MessageFactory.FLAGS_COMPRESSED)
  File "/Users/ach/projects/pyrotest/lib/python2.7/site-
packages/Pyro4/util.py", line 149, in deserializeData
    return self.loads(data)
  File "/Users/ach/projects/pyrotest/lib/python2.7/site-
packages/Pyro4/util.py", line 373, in loads
    return self.recreate_classes(serpent.loads(data))
  File "/Users/ach/projects/pyrotest/lib/python2.7/site-
packages/Pyro4/util.py", line 303, in recreate_classes
    return self.dict_to_class(literal)
  File "/Users/ach/projects/pyrotest/lib/python2.7/site-
packages/Pyro4/util.py", line 282, in dict_to_class
    raise Pyro4.errors.ProtocolError("unsupported serialized class: 
"+classname)
Pyro4.errors.ProtocolError: unsupported serialized class: Thingy
$


Changing the serializer to pickle makes the example work. Changing it to 
json or marshal leads to similar tracebacks.

 - Matt

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.