hi, I have a proto file, message Block { required uint32 code1 = 1; required uint32 code2 = 2; }
Encoding is done using protobuf-c.code1 is populated by right shifting a 64-bit integer, For Ex: uint64_t temp ; code1 = temp >> 32; Now encoding is successful.Decoding in protobuf-c is successful. Decoding in python-protobuf failed with the below error. 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. Can you tell me why the python decoder is failing with this error ? If i dont do an shifting operation while encoding and hard-code, the decoding script works fine. 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 protobuf+unsubscr...@googlegroups.com. To post to this group, send email to protobuf@googlegroups.com. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.