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
?
1 Answer
Reset to default 1How 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 newUnknownFieldSet(message)
support in unknown_fields.py as a replacement.
You will want to update your code to use the new public API.
本文标签:
版权声明:本文标题:protocol buffers - How to access unknown fields in python protobuf version 5.38.3 with upb backend - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745644351a2668045.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论