I am using protobuf v2.4.0 in Windows and having problems.
Say I have following message file. 'foo.proto'
message School
{
optional int32 students = 1;
}
from which I generated description set file 'foo.desc' like this:
protoc -o foo.desc foo.proto
and, reading description set file..
from google.protobuf.descriptor_pb2 import FileDescriptorSet
fds = FileDescriptorSet()
fds.ParseFromString(open('foo.desc').read())
generates following error message:
File "build\bdist.win32\egg\google\protobuf\message.py", line 179,
in ParseFromString
File "build\bdist.win32\egg\google\protobuf\internal
\python_message.py", line 755, in MergeFromString
File "build\bdist.win32\egg\google\protobuf\internal
\python_message.py", line 782, in InternalParse
File "build\bdist.win32\egg\google\protobuf\internal\decoder.py",
line 521, in DecodeRepeatedField
google.protobuf.message.DecodeError: Truncated message.
Strangely enough, when I changed field name from 'students' to
'student', no error occurred.
Any ideas?
--
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en.