[protobuf] Issue 278 in protobuf: SerializeToString fail if nested types all field is empty
Status: New Owner: liuj...@google.com Labels: Type-Defect Priority-Medium New issue 278 by muzuiget: SerializeToString fail if nested types all field is empty http://code.google.com/p/protobuf/issues/detail?id=278 version protobuf-2.4.0a, python2.6 ubuntu 10.10 install from source tarball with easy_install. If define a proto file as below $cat test.proto message Child { repeated int32 a = 1; repeated int32 b = 2; } message Partent { required Child child = 1; } generate a python class file, run code as below $ cat test1.py import test_pb2 p = test_pb2.Partent() print p p.SerializeToString() $ python test1.py Traceback (most recent call last): File "test1.py", line 4, in p.SerializeToString() File "/usr/local/lib/python2.6/dist-packages/protobuf-2.4.0a-py2.6.egg/google/protobuf/internal/python_message.py", line 730, in SerializeToString ','.join(self.FindInitializationErrors())) google.protobuf.message.EncodeError: Message is missing required fields: child Because both child.a and child.b are empty, it cause child empty. A solution is change the Child tag to "optional". I don't know it is a feature or bug. But if I run $ cat test2.py import test_pb2 p = test_pb2.Partent() print p print p.child.a p.child.a.append(1) p.child.a.remove(1) print p print p.child.a p.SerializeToString() $ python test2.py [] child { } [] After append and remove, child.a and child.b sitll empty, but this time child is not empty, SerializeToString success. -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@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.
[protobuf] Python Client: pickling error
Environment: CentOS 64bit Python 2.6 Protocol Buffers 2.4.0.a Python client with Native C++ support python protocol buffers installed to ~/protobuf LD_LIBRARY_PATH=~/protobuf/lib:~/protobuf/google/protobuf/src/.libs PYTHONPATH=:~/protobuf/:.:~/protobuf/google/protobuf/src/.libs:~/ protobuf/lib Hi, In a multiprocessing environment, my code is trying to add decoded messages to a shared Queue, and then pop them off at a later stage. Inserting messages in the Queue is working fine. But while fetching those messages, am getting this error: Traceback (most recent call last): File "/usr/lib64/python2.6/multiprocessing/queues.py", line 242, in _feed send(obj) PicklingError: Can't pickle : import of module google3.net.google.protobuf.python.internal._net_proto2___python failed Verified LD_LIBRARY_PATH, LD_RUN_PATH, PYTHONPATH and they all seem to be valid. Anyway help in solving this problem is appreciated. Inserting messages to Queue: while not self.stopped(): el = self.rcvr.next_message() if el is not None: print "%s is the event"%el Q.put(el) Popping messages off Queue: def next_message(self): """Returns next event (if available) from Queue""" return Q.get() where Q is multiprocessing.Queue -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@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.
[protobuf] Issue 277 in protobuf: warning: [serial] serializable class has no definition of serialVersionUID
Status: New Owner: liuj...@google.com Labels: Type-Defect Priority-Medium New issue 277 by chiragpa...@gmail.com: warning: [serial] serializable class has no definition of serialVersionUID http://code.google.com/p/protobuf/issues/detail?id=277 Hi, We are still getting these serialization warnings reported in http://code.google.com/p/protobuf/issues/detail?id=246 We are using 2.4.0a release. We upgraded from 2.3.0 where it was not giving such warnings. I am not sure if I need to do anything special with my proto files here to generate serialVersionUID definition? one of the proto files attached here. Thanks, -Chirag Attachments: error.proto 194 bytes -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to protobuf@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.