New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the _pb2 suffix in the file name for protocol files generated with protoc #14
Comments
+1 |
@tgalal are you alive? |
Ubuntu 16.10 brings python-protobuf 3.0.0. Now even more python-axolotl users are facing this issue. Antonio's patch works great, but one cannot ask non tech-savvy users to patch python-axolotl themselves. @tgalal could you please merge these changes? It seems to be a quick job. |
@ao2 Thanks. I've opened a bug report in Ubuntu's bugtracker: Bug #1637958 “Use _pb2 suffix in protobuf's generated files” : Bugs : python-axolotl package : Ubuntu |
I have sent a pull request to master branch, since another people may face the same issue. #17 While it is not merged here, you can clone my master branch. |
@ao2 sorry it took me too long. I merged your patch, I think the names and everything is fine now as it is in your patch. Thanks a lot! |
Hi,
since python-protobuf 3.0.0 landed in Debian, programs using
python-axolotl
fail with a message like this:The same happens when running the tests with
python2.7 -m unittest discover -v
.As analyzed in Debian bug #835271 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835271) it looks like this is an issue in
python-axolotl
rather than inpython-protobuf
itself, basically the newer protobuf code checks that the generated protocol files have the_pb2.py
suffix in their names, and this does not happen inpython-axolotl
.The issue happens only when PyPy is not used (https://github.com/google/protobuf/blob/2fe0556c7abbe31c02147b9171397737a35bfe3b/python/google/protobuf/pyext/descriptor.cc#L94) which apparently is the case for the
python-protobuf
Debian package.This behavior also looks consistent with the protbuf documentation: https://developers.google.com/protocol-buffers/docs/pythontutorial#compiling-your-protocol-buffers even if the doc does not state clearly that having the
_pb2
suffix is a requirement.Anyway, renaming the generated protbuf files fixes the issue, see this patch:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=835271;filename=0001-Keep-the-_pb2-suffix-in-the-name-for-protobuf-genera.patch;msg=22
Should I submit a pull request? Against the develop branch?
Another question: the protobuf documentation suggests to use the same base name used for the .proto files also in the generated files, in
python-axolotl
that would mean havingWhisperTextProtocol_pb2.py
instead ofwhisperprotos.py
andLocalStorageProtocol_pb2.py
instead ofstorageprotos.py
; or alternatively have the protocol files namedwhisperprotos.proto
andstorageprotos.proto
.Do you want to follow this scheme that makes it clear what the generated files are, or do you want to keep the current names?
Thanks,
Antonio
The text was updated successfully, but these errors were encountered: