admin管理员组

文章数量:1434881

I'm using Python protobuf package version 5.38.3 for deserializing some packets and I need to check if the messages I deserialize are conformant or not to a specific protobuf message structure. For some checks I want to obtain the list of unknown fields.

This post points to an API UnknownFields() supported by messages, but when I call it in a deserialized message it raises NotImplementedError.

How can I get access to the list of unknown fields from a deserialized message in protobuf 5.28.3?

I'm using Python protobuf package version 5.38.3 for deserializing some packets and I need to check if the messages I deserialize are conformant or not to a specific protobuf message structure. For some checks I want to obtain the list of unknown fields.

This post points to an API UnknownFields() supported by messages, but when I call it in a deserialized message it raises NotImplementedError.

How can I get access to the list of unknown fields from a deserialized message in protobuf 5.28.3?

Share Improve this question asked Nov 16, 2024 at 20:09 V.LorzV.Lorz 3952 silver badges13 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

How can I get access to the list of unknown fields

Here, let me google that for you.

https://protobuf.dev/news/2023-08-15

Python Breaking Change

In v25 message.UnknownFields() will be deprecated in pure Python and C++ extensions. It will be removed in v26. Use the new UnknownFieldSet(message) support in unknown_fields.py as a replacement.

You will want to update your code to use the new public API.

本文标签: