Skip to content

cannot use 'google.protobuf.internal.containers.RepeatedScalarFieldContainer' as a dict key (unhashable type: 'RepeatedScalarFieldContainer') #36

@0xdeaddc0de

Description

@0xdeaddc0de

Encoutered the following while doing :
Step 1 -> Extract From Binary

Error calling Python override of QThread::run(): Traceback (most recent call last):
  File "/usr/share/pbtk/gui.py", line 467, in run
    for name, contents in self.extractor['func'](input_):
                          ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/share/pbtk/extractors/from_binary.py", line 77, in walk_binary
    yield descpb_to_proto(proto)
          ~~~~~~~~~~~~~~~^^^^^^^
  File "/usr/share/pbtk/utils/descpb_to_proto.py", line 44, in descpb_to_proto
    out += parse_msg(desc, scopes, desc.syntax).strip('\n')
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/pbtk/utils/descpb_to_proto.py", line 59, in parse_msg
    blocks[nested_msg.name] = parse_msg(nested_msg, scopes, syntax)
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/pbtk/utils/descpb_to_proto.py", line 78, in parse_msg
    out += fmt_field(field, scopes, blocks, syntax)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/pbtk/utils/descpb_to_proto.py", line 167, in fmt_field
    line = '%s %s %s = %s;\n' % (labels[field.label], type_, field.name, fmt_value(field.number, field.options, optarr=default))
                                                                         ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/pbtk/utils/descpb_to_proto.py", line 125, in fmt_value
    opts.append('%s = %s' % (option.name, fmt_value(value, desc=option)))
                                          ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/pbtk/utils/descpb_to_proto.py", line 117, in fmt_value
    val = desc.enum_type.values_by_number[val].name
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
TypeError: cannot use 'google.protobuf.internal.containers.RepeatedScalarFieldContainer' as a dict key (unhashable type: 'RepeatedScalarFieldContainer')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions