[protobuf] Python ParseFromString failing

2010-01-22 Thread Xavier
I'm currently writing a python listener than is receiving a protocol
buffer from a UDP multicast transport.  The sender is written in C.
I'm using Protocol Buffers 2.2a and my python code is also using
Twisted.

Thanks in advance,

-Xavier

This is the error I get from my code:

Traceback (most recent call last):
  File /usr/lib64/python2.4/site-packages/twisted/python/log.py,
line 33, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
  File /usr/lib64/python2.4/site-packages/twisted/python/context.py,
line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args,
**kw)
  File /usr/lib64/python2.4/site-packages/twisted/python/context.py,
line 37, in callWithContext
return func(*args,**kw)
  File /usr/lib64/python2.4/site-packages/twisted/internet/
selectreactor.py, line 139, in _doReadOrWrite
why = getattr(selectable, method)()
--- exception caught here ---
  File /usr/lib64/python2.4/site-packages/twisted/internet/udp.py,
line 127, in doRead
self.protocol.datagramReceived(data, addr)
  File ./bdc_receiver.py, line 22, in datagramReceived
self.message.ParseFromString(repr(datagram))
  File build/bdist.linux-x86_64/egg/google/protobuf/message.py, line
159, in ParseFromString

  File build/bdist.linux-x86_64/egg/google/protobuf/reflection.py,
line 1238, in MergeFromString

  File build/bdist.linux-x86_64/egg/google/protobuf/reflection.py,
line 1082, in _DeserializeOneEntity

exceptions.RuntimeError: TODO(robinson): Wiretype mismatches not
handled.

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.



Re: [protobuf] Python ParseFromString failing

2010-01-22 Thread Kenton Varda
Please verify that the bytes you are trying to parse are *exactly* the same
bytes that came out of the serializer on the sending end.  You could, for
example, print a checksum on both sides to manually verify that they are the
same.

On Fri, Jan 22, 2010 at 3:00 PM, Xavier xavier.stev...@gmail.com wrote:

 I'm currently writing a python listener than is receiving a protocol
 buffer from a UDP multicast transport.  The sender is written in C.
 I'm using Protocol Buffers 2.2a and my python code is also using
 Twisted.

 Thanks in advance,

 -Xavier

 This is the error I get from my code:

 Traceback (most recent call last):
  File /usr/lib64/python2.4/site-packages/twisted/python/log.py,
 line 33, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
  File /usr/lib64/python2.4/site-packages/twisted/python/context.py,
 line 59, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args,
 **kw)
  File /usr/lib64/python2.4/site-packages/twisted/python/context.py,
 line 37, in callWithContext
return func(*args,**kw)
  File /usr/lib64/python2.4/site-packages/twisted/internet/
 selectreactor.py, line 139, in _doReadOrWrite
why = getattr(selectable, method)()
 --- exception caught here ---
  File /usr/lib64/python2.4/site-packages/twisted/internet/udp.py,
 line 127, in doRead
self.protocol.datagramReceived(data, addr)
  File ./bdc_receiver.py, line 22, in datagramReceived
self.message.ParseFromString(repr(datagram))
  File build/bdist.linux-x86_64/egg/google/protobuf/message.py, line
 159, in ParseFromString

  File build/bdist.linux-x86_64/egg/google/protobuf/reflection.py,
 line 1238, in MergeFromString

  File build/bdist.linux-x86_64/egg/google/protobuf/reflection.py,
 line 1082, in _DeserializeOneEntity

 exceptions.RuntimeError: TODO(robinson): Wiretype mismatches not
 handled.

 --
 You received this message because you are subscribed to the Google Groups
 Protocol Buffers group.
 To post to this group, send email to proto...@googlegroups.com.
 To unsubscribe from this group, send email to
 protobuf+unsubscr...@googlegroups.comprotobuf%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/protobuf?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.