dpkt
dpkt copied to clipboard
bitfield unittest might be platform dependant
This test gives me trouble.
https://github.com/kbandla/dpkt/blob/2d30526422d48f83d4f724221d9ae0dcd5ff57fe/dpkt/dpkt.py#L62-L65
I think it should not be called on ph_struct
but a concat of the classes __byte_order__
and it, no?
On my system the test tells me L
is expected to be 8*8bits instead of 32, I'd expect.
https://docs.python.org/3/library/struct.html#format-characters
Am I just overlooking something? I'll provide a PR with a unittest with what I mean tomorrow, if wanted.
A piece of code to replicate the issue would be helpful, yes.
__byte_order__
isn't related to sizing, I don't think it needs to be involved.
I'll provide the example tomorrow morning, then.
I've got a working unittest, as well as a draft for a fix. It will take a little while longer though, due to company policies - sorry for the wait.
@obormot This took way longer than anticipated. Future contributions should be faster.