Bitcoin-ABC / ElectrumABC

Mirror of https://reviews.bitcoinabc.org/source/bitcoin-abc/browse/master/electrum/

Home Page:https://bitcoinabc.org/electrum

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

protobuf generated file outdated

PiRK opened this issue · comments

Protobuf seems to have made a backwards incompatible change in version 3.21 (released on May 26th 2022)

Traceback (most recent call last):
  File "/usr/local/bin/coverage", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/site-packages/coverage/cmdline.py", line 943, in main
    status = CoverageScript().command_line(argv)
  File "/usr/local/lib/python3.10/site-packages/coverage/cmdline.py", line 659, in command_line
    return self.do_run(options, args)
  File "/usr/local/lib/python3.10/site-packages/coverage/cmdline.py", line 830, in do_run
    runner.run()
  File "/usr/local/lib/python3.10/site-packages/coverage/execfile.py", line 160, in run
    self._prepare2()
  File "/usr/local/lib/python3.10/site-packages/coverage/execfile.py", line 124, in _prepare2
    pathname, self.package, self.spec = find_module(self.modulename)
  File "/usr/local/lib/python3.10/site-packages/coverage/execfile.py", line 43, in find_module
    spec = importlib.util.find_spec(modulename)
  File "/usr/local/lib/python3.10/importlib/util.py", line 94, in find_spec
    parent = __import__(parent_name, fromlist=['__path__'])
  File "/tmp/cirrus-ci-build/electroncash/__init__.py", line 5, in <module>
    from .wallet import Synchronizer, Wallet
  File "/tmp/cirrus-ci-build/electroncash/wallet.py", line 85, in <module>
    from . import paymentrequest
  File "/tmp/cirrus-ci-build/electroncash/paymentrequest.py", line 40, in <module>
    from . import paymentrequest_pb2 as pb2
  File "/tmp/cirrus-ci-build/electroncash/paymentrequest_pb2.py", line 35, in <module>
    _descriptor.FieldDescriptor(
  File "/usr/local/lib/python3.10/site-packages/google/protobuf/descriptor.py", line 560, 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