protocol buffers - How to access unknown fields in python protobuf version 5.38.3 with upb backend - Stack Overflow

I'm using Python protobuf package version 5.38.3 for deserializing some packets and I need to chec

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745644352a4637880.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信