Bug 509477 - protobuf python binding broken in F11
protobuf python binding broken in F11
Product: Fedora
Classification: Fedora
Component: protobuf (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: Lev Shamardin
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-07-02 22:19 EDT by Conrad Steenberg
Modified: 2010-02-13 02:12 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-02-13 02:12:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Conrad Steenberg 2009-07-02 22:19:19 EDT
See http://code.google.com/p/protobuf/issues/detail?id=46

Description of problem:
Python binding of protobuf 2.0.2 broken on import, quoted from the Google bug:

import google.protobuf.descriptor_pb2

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

There should be no output on a successful import of this code, but instead
this error occurs:

Python 2.6 (r26:66721, Oct  2 2008, 11:35:03) [MSC v.1500 32 bit (Intel)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import google.protobuf.descriptor_pb2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...\lib\site-packages\google\protobuf\descriptor_pb2.py", line 737,
in <module>
    class FileDescriptorSet(message.Message):
  File "...\lib\site-packages\google\protobuf\reflection.py", line 141, in
    superclass.__init__(cls, name, bases, dictionary)
TypeError: Error when calling the metaclass bases
    type.__init__() takes 1 or 3 arguments

Version-Release number of selected component (if applicable):

How reproducible:

How to fix:
Update to protobuf-2.0.3 or later
Comment 1 Eric Hopper 2009-08-31 02:08:07 EDT
It can be fixed by hand editing the superclass.__init__ call to not include the cls parameter.  But that's really, really ugly.

There is a much newer version (2.2.0) of protobuf available that fixes this issue and also includes numerous speed improvements.  I also know that a version is coming fairly soon that includes some Python specific speed improvements.
Comment 2 Eric Hopper 2010-02-13 01:40:01 EST
This is now fixed since protobuf 2.2.0 was released, which was a couple of months ago at least.

Note You need to log in before you can comment on or make changes to this bug.