[Pkg-protobuf-devel] Bug#835271: python-protobuf returns " TypeError: Descriptors should not be created directly, but only retrieved from their parent" message

Josue Ortega josue at debian.org
Wed Aug 24 03:01:59 UTC 2016


Package: python-protobuf
Version: 3.0.0-1
Severity: important

Dear Maintainer,

Currently I am getting the following error trying to use Python protobuf
generated code:

 File "/usr/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 501, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors should not be created directly, but only retrieved from their parent.

At the beginning I thought it was a problem of the piece of the software that is
using the generated python protobuf code, after regenerating the protobuf code
the same error is returned even if I use proto2 or proto3 syntax.

Then I removed python-protobuf package and installed the PyPi version[1] and the
software worked like a charm.

If you want to reproduce this, you can checkout the following repository:
 https://github.com/tgalal/python-axolotl.git
and run:
 python2.7 -m unittest discover -v

Cheers

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=es_GT.UTF-8, LC_CTYPE=es_GT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python-protobuf depends on:
ii  libc6                 2.23-4
ii  libgcc1               1:6.2.0-1
ii  libprotobuf10         3.0.0-1
ii  libstdc++6            6.2.0-1
ii  python                2.7.11-2
ii  python-pkg-resources  25.2.0-1
ii  python-six            1.10.0-3
pn  python:any            <none>

python-protobuf recommends no packages.

python-protobuf suggests no packages.

-- no debconf information



More information about the Pkg-protobuf-devel mailing list