Skip to content

TypeError: unhashable type: 'RepeatedScalarFieldContainer' #30

@dmiller423

Description

@dmiller423

Scanning elf containing obvious protobuf's

Traceback (most recent call last):
  File "c:\path_to\pbtk\gui.py", line 462, in run
    for name, contents in self.extractor['func'](input_):
  File "c:\path_to\pbtk\extractors\from_binary.py", line 78, in walk_binary
    yield descpb_to_proto(proto)
          ^^^^^^^^^^^^^^^^^^^^^^
  File "c:\path_to\pbtk\utils\descpb_to_proto.py", line 45, in descpb_to_proto
    out += parse_msg(desc, scopes, desc.syntax).strip('\n')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\path_to\pbtk\utils\descpb_to_proto.py", line 60, in parse_msg
    blocks[nested_msg.name] = parse_msg(nested_msg, scopes, syntax)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\path_to\pbtk\utils\descpb_to_proto.py", line 79, in parse_msg
    out += fmt_field(field, scopes, blocks, syntax)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\path_to\pbtk\utils\descpb_to_proto.py", line 168, in fmt_field
    line = '%s %s %s = %s;\n' % (labels[field.label], type_, field.name, fmt_value(field.number, field.options, optarr=default))
                                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\path_to\pbtk\utils\descpb_to_proto.py", line 126, in fmt_value
    opts.append('%s = %s' % (option.name, fmt_value(value, desc=option)))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\path_to\pbtk\utils\descpb_to_proto.py", line 118, in fmt_value
    val = desc.enum_type.values_by_number[val].name
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
TypeError: 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