Open s-snowden opened 7 years ago
Hi. Thanks for reporting the issue. The patch looks good.
kwargs
is guraranteed to have endian
we can use kwargs['endian']
instead of kwargs.get
uint_field
with the patch? If I am not mistaken, kwargs['endian']
will get native
. In this case pack
will reverse the order regardless of endianity, and unpack
will reverse the order even on big-endian platforms.Would you like to open a pull request with the patch so we can merge a commit that comes from you?
However, it will be better if the fix will be a part of pack_bit_int
and not pack_int
.
Also, thanks for the offer to contribute, we'll be glad for additional CDBs.
I agree that pack_bit_int is more appropriate. That patch was just to solve my immediate problem. I'll do the pull request with a more complete solution.
Sorry for the annoyance, but I haven't used git or github before. I cloned the repo, added some unit tests and my fix, and committed it locally, but when I went to push it back, I got a permission error. What did I do wrong?
The steps I took were:
Thanks!
Hi again,
Any changes you make have to be pushed to your forked copy of infi.instruct, and later be accepted to our repo in a pull request.
So, all work should be with your forked repo.
As for you example, you need to change your 1st command to:
git clone https://github.com/s-snowden/infi.instruct
And your 4th command to:
git push https://github.com/s-snowden/infi.instruct
When you're done, create a pull request (theres' a "new pull request" button in your repository web GUI).
Good luck! :)
Are there any updates to this issue? I'm experiencing an issue with this limitation currently. The PR was merged, but was backed out in this commit.
Is there a more graceful solution in mind @grzn ? Thanks!
On a little-endian Windows machine, be_uint_fields with a size of 3 are not properly packed and unpacked. I believe this would be the case on other platforms too, and for any byte_size not handled by the standard struct pack stuff.
The followng snippet demonstrates the problem:
The code above generates the following output:
It should generate:
The following patch corrects the problem:
These are some nice modules you've created. I'd be happy to contribute some additional CDBs if you're interested.