-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Check parameters of int.from_bytes #6562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! I have made some suggestions (which are not tested!).
Added a validation for the byteorder parameter. Not sure if this is was necessary. I added MP_QSTR_big here, but I am not sure how to the qstrdefs.enum.h file.
The qstr will get added automatically; you don't need to do anything. The sources are scanned to generate the qstr's when a build is done. Make sure to do make clean
if you change or add any qstr's, though.
I don't know whether you changed circuitpython.pot
by hand or not. You don't need to. Just run make translate
before committing, and it will be updated automatically.
The Metro M0 Express |
@isacben I just want to know if you retested. |
Hi @dhalbert , Thank you very much for the helpful feedback!! Yes, I am testing with the Feather RP2040. This is the only one I have, unfortunately!
I think this would fix it:
Please let me know what you think. Thank you in advance!! |
This is only because the { MP_QSTR_bytes, MP_ARG_REQUIRED | MP_ARG_OBJ, {0} },
{ MP_QSTR_byteorder, MP_ARG_REQUIRED | MP_ARG_OBJ, {0} }, |
Thanks Dan! I will take your advice on the initialization. It seems now the build is too big for the Metro MO Express and the Nano 33 IoT. Please let me know if there is any recommendation on this regard. Probably I went too far with the idea of adding the signed parameter and the byteorder validation! Thank you! |
@isacben I will not be able to work on this for about a week or so, but will get back to you about shrinking those builds. Thanks for working on this. |
Hi @dhalbert, |
…ben/circuitpython into from_bytes-check-parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes to make things fit, and updated some infrastructure things.
@jepler @tannewt I made the unix port use -std=gnu11
instead of gnu99
. We don't need to support really old compilers. Also made a change to not include the ru
font on SAMD21 builds, and built Feather ESP32-S3 TFT with -Os
instead of -O2
, rather than starting to disable more modules to make it fit.
Hi @dhalbert, Thank you very much for your help! I will have a look to the changes you made to learn about ways to shrink the builds! Thank you! |
Hi,
I am opening this PR to solve #6419. This is what I am trying to do:
NotImplementedError
ifsigned=True
is passed.byteorder
parameter. Not sure if this is was necessary. I addedMP_QSTR_big
here, but I am not sure how to theqstrdefs.enum.h
file.Please let me know if you have any feedback so I can review.
Thank you!