protobuf
protobuf copied to clipboard
python: invalid uint32_t value convertion
Version: 27.0-rc1 (and older versions, up to 624d29d commit, but maybe i'm wrong). Language: Python OS: Linux Python 3.11, protobuf installed from pip with --cpp_implementation flag
Big uint32_t values from protobuf (encoded by C++ code) from python side is are negative And problem is here: PyLong_FromSsize_t should be replaced by PyLong_FromUnsignedLong (or PyLong_FromSize_t, i'm not sure).
Thank you Alexander to raise it up. Can you help to give an example code to show the bug?
I'm sorry, i did forget about one thing: it's but affects only 32-bit platforms like i386/arm32 :( But i did reproduce it with simple examples and little bit of docker magic: protobuf_bug_example.tar.gz This archive contains simple C++ message generator and python message parser which check parsed uint32 value from message; Dockerfile for environment build and run.sh, which run all this stuff properly.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive
because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.
This issue was closed and archived because there has been no new activity in the 14 days since the inactive
label was added.