protobuf | 1 Jul 2011 03:59

Re: Issue 306 in protobuf: Python: Message objects should not be hashable


Comment #2 on issue 306 by matt.gi... <at> gmail.com: Python: Message objects  
should not be hashable
http://code.google.com/p/protobuf/issues/detail?id=306

Ah, my apologies. I was using 2.3.0. It appears to be fixed for me  
(Messages are now unhashable).

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

Ruslan Mullakhmetov | 1 Jul 2011 15:12
Picon

Re: dynamic deserialize message in Python

thanks you. I will try to use it. 

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/qTti8sI2NFMJ.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
platzhirsch | 2 Jul 2011 17:36
Gravatar

Exceptions when reading protobuf messages in Java which were created in C++

I am using **protobuf** now for some weeks, but I still keep getting
exceptions when parsing protobuf messages in **Java**.

I use **C++** to create my protobuf messages and send them with
**boost sockets** to a server socket where the Java client ist
listening. The C++ code for transmitting the message is  this:

        boost::asio::streambuf b;
	std::ostream os(&b);

	ZeroCopyOutputStream *raw_output = new OstreamOutputStream(&os);
	CodedOutputStream *coded_output = new CodedOutputStream(raw_output);

	coded_output->WriteVarint32(agentMessage.ByteSize());
	agentMessage.SerializeToCodedStream(coded_output);

	delete coded_output;
	delete raw_output;

	boost::system::error_code ignored_error;

	boost::asio::async_write(socket, b.data(), boost::bind(
			&MessageService::handle_write, this,
			boost::asio::placeholders::error));

As you can see I write with `WriteVarint32` the length of the message,
thus the Java side should know by using `parseDelimitedFrom` how far
it should read:

    AgentMessage agentMessage = AgentMessageProtos.AgentMessage
                                    .parseDelimitedFrom(socket.getInputStream());

But it's no help, I keep getting these kind of Exceptions:

    Protocol message contained an invalid tag (zero).
    Message missing required fields: ...

It is **important** to know, that these exceptions are not thrown on
every message. This is only a fraction of the messages I receive the
most work out just fine - still I would like to fix this since I do
not want to omit the messages.

I would be really gratful if someone could help me out or spent his
ideas.

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

platzhirsch | 2 Jul 2011 17:55
Gravatar

Re: Exceptions when reading protobuf messages in Java which were created in C++

Some other exceptions I receive as well:

Protocol message tag had invalid wire type.
Protocol message end-group tag did not match expected tag.
While parsing a protocol message, the input ended unexpectedly in the
middle of a field.  This could mean either than the input has been
truncated or that an embedded message misreported its own length.

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

protobuf | 4 Jul 2011 11:40

Issue 310 in protobuf: protoc generates uncompilable java code

Status: New
Owner: liuj... <at> google.com
Labels: Type-Defect Priority-Medium

New issue 310 by sergei.s... <at> gmail.com: protoc generates uncompilable java  
code
http://code.google.com/p/protobuf/issues/detail?id=310

When the following protobuf definition is supplied to protoc (2.4.1), the  
generated java code does not compile because of conflicting unqualified  
references to different String classes.

message Message {
     message String {
     }

     required String string1 = 1;
     required string string2 = 2;
}

protoc should always output fully-qualified name for java.lang.String in  
the generated code.

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

protobuf | 4 Jul 2011 14:11

Issue 311 in protobuf: PyPI packages cannot be installed with PIP

Status: New
Owner: liuj... <at> google.com
Labels: Type-Defect Priority-Medium

New issue 311 by jka... <at> kakar.ca: PyPI packages cannot be installed with PIP
http://code.google.com/p/protobuf/issues/detail?id=311

What steps will reproduce the problem?
1. Run 'pip install protobuf'

What is the expected output? What do you see instead?

I expect the protobuf package to be installed, but instead see this:

$ sudo pip install protobuf
Downloading/unpacking protobuf
   Downloading protobuf-2.4.1.tar.bz2 (1.4Mb): 1.4Mb downloaded
   Running setup.py egg_info for package protobuf
     Traceback (most recent call last):
       File "<string>", line 14, in <module>
     IOError: [Errno 2] No such file or  
directory: '/home/jkakar/src/fluidinfo/fluiddb/branches/implicit-paths-790115/build/protobuf/setup.py'
     Complete output from command python setup.py egg_info:
     Traceback (most recent call last):

   File "<string>", line 14, in <module>

IOError: [Errno 2] No such file or  
directory: '/home/jkakar/src/fluidinfo/fluiddb/branches/implicit-paths-790115/build/protobuf/setup.py'

----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/jkakar/.pip/pip.log

What version of the product are you using? On what operating system?

I'm using the latest version on PyPI with an up-to-date Ubuntu 11.04
system.

Please provide any additional information below.

The issue is that the tarball uploaded to PyPI doesn't have a setup.py
in the root of the package.  Probably the right thing to do is to
upload just the python/ directory.

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

protobuf | 4 Jul 2011 19:40

Re: Issue 311 in protobuf: PyPI packages cannot be installed with PIP


Comment #1 on issue 311 by g... <at> krypto.org: PyPI packages cannot be  
installed with PIP
http://code.google.com/p/protobuf/issues/detail?id=311

http://pypi.python.org/pypi/protobuf appears to only list version 2.3.0  
rather than the later (2.4.1 today) version on the  
http://code.google.com/p/protobuf/downloads/list project.

the 2.3.0 tar.gz listed on pypi is just the contents of the python/  
directory of the full protobuf tarball.

In order for this to work via pip install I don't think including just the  
python/ subdirectory is the right thing to do; that'd mean the C++  
extension module version of the API that wraps the C++ protobuf API could  
not be compiled and used.

A top level setup.py suitable for pip above the python/ subdirectory might  
be a better answer than just a python only package.

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

english ren | 5 Jul 2011 04:09
Picon
Gravatar

[protobuf] 回复:Is there native(C++) support for json serialization/deserialization?

Hi , I wrote a simple library for this , you can decode protobuf to json with it . https://github.com/renenglish/pb2json

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/lnjhPbf1dXQJ.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
protobuf | 5 Jul 2011 06:48

Re: Issue 310 in protobuf: protoc generates uncompilable java code

Updates:
	Status: Accepted

Comment #1 on issue 310 by liuj... <at> google.com: protoc generates  
uncompilable java code
http://code.google.com/p/protobuf/issues/detail?id=310

This was fixed in r393. Please patch/sync r393, or wait for the next  
release.

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

protobuf | 5 Jul 2011 06:54

Re: Issue 309 in protobuf: Support for C-style comments in editors/proto.vim

Updates:
	Status: Accepted

Comment #1 on issue 309 by liuj... <at> google.com: Support for C-style comments  
in editors/proto.vim
http://code.google.com/p/protobuf/issues/detail?id=309

Fixed in r389, will be included in the next release.

--

-- 
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To post to this group, send email to protobuf <at> googlegroups.com.
To unsubscribe from this group, send email to protobuf+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.


Gmane