Skip to content
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

Broken with latest protobuf? #242

Open
ross-at-bond opened this issue Jun 12, 2022 · 1 comment · May be fixed by #244
Open

Broken with latest protobuf? #242

ross-at-bond opened this issue Jun 12, 2022 · 1 comment · May be fixed by #244

Comments

@ross-at-bond
Copy link

Looks like the package is broken with newer protobuf packages? I get this error message after a dependency update in a project using this module:

  ...
  File "/baas/app/eventstore/eventstore_db.py", line 4, in <module>
    import photonpump
  File "/usr/local/lib/python3.8/site-packages/photonpump/__init__.py", line 3, in <module>
    from .connection import *  # noqa
  File "/usr/local/lib/python3.8/site-packages/photonpump/connection.py", line 12, in <module>
    from . import conversations as convo
  File "/usr/local/lib/python3.8/site-packages/photonpump/conversations.py", line 16, in <module>
    from photonpump import messages
  File "/usr/local/lib/python3.8/site-packages/photonpump/messages.py", line 10, in <module>
    from . import messages_pb2
  File "/usr/local/lib/python3.8/site-packages/photonpump/messages_pb2.py", line 32, in <module>
    _descriptor.EnumValueDescriptor(
  File "/usr/local/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 755, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
lisael added a commit to lisael/photon-pump that referenced this issue Feb 8, 2023
@lisael lisael linked a pull request Feb 8, 2023 that will close this issue
@lisael
Copy link

lisael commented Feb 8, 2023

@ross-at-bond ^^this MR^^ fixes the issue... as long as you don't need a newer version of protobuf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants