Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 231 by krumpligyar: python SerializePartialToString raises 'Required field missing' in case of nested required fields
http://code.google.com/p/protobuf/issues/detail?id=231

The following call stack should never happen. (SerializePartialToString calls SerialzeToString and then raises, because required fields are missing.)


File "/usr/lib/pymodules/python2.6/google/protobuf/reflection.py", line 885, in SerializePartialToString
    field_descriptor, encoder)
File "/usr/lib/pymodules/python2.6/google/protobuf/reflection.py", line 802, in _SerializeValueToEncoder
    method(encoder, field_number, value)
File "/usr/lib/pymodules/python2.6/google/protobuf/internal/encoder.py", line 260, in AppendMessage
    self._stream.AppendRawBytes(msg.SerializeToString())
File "/usr/lib/pymodules/python2.6/google/protobuf/reflection.py", line 847, in SerializeToString
    raise message_mod.EncodeError('\n'.join(errors))
EncodeError: Required field scarab.HashedInversion.inversion is not set.


My proto looked like this:

message Foo {
  required int32 i = 1;
}

message Bar {
  required Foo foo = 2;
}

I'm using python2.6 under ubuntu lynx.

Thanks,
Daniel

--
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.

Reply via email to