Hi,

When encoding a unsigned integer variable I am right shifting it by 32 
bits. 
Using protobuf-c, the same is decoded properly.
but the problem seems to appear while decoding in .python-protobuf.  Can 
you tell what is the reason for this ? 
Proto file:
======
message BlockID
{
        required uint32 code1 = 1;
        required uint32 code2 = 2;
}

RIGHT SHIFT:
==========
uint64_t temp = 40;
code1 = temp >> 32;

Error Trace:
========
 File "./decode_rnis_msg_p.py", line 24, in est_decode
    codefile.ParseFromString(buff)
  File "/usr/lib/python2.7/site-packages/google/protobuf/message.py", line 
186, in ParseFromString
    self.MergeFromString(serialized)
  File 
"/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", 
line 839, in MergeFromString
    if self._InternalParse(serialized, 0, length) != length:
  File 
"/usr/lib/python2.7/site-packages/google/protobuf/internal/python_message.py", 
line 872, in InternalParse
 pos = field_decoder(buffer, new_pos, end, self, field_dict)
  File 
"/usr/lib/python2.7/site-packages/google/protobuf/internal/decoder.py", 
line 631, in DecodeRepeatedField
    raise _DecodeError('Truncated message.')
google.protobuf.message.DecodeError: Truncated message.


Regards,
Wahid

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to