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
htonl et al accept negative ints #44462
Comments
Referencing bug 1619659 This patch ensures that htonl and friends never accept or return negative numbers, per the underlying C implementation. I wrote a test case to ensure things work as expected, and ensured all tests pass. |
Thanks, submitted. (Note that I had to fix the indentation in your patch; you used four spaces where the original code used tabs. Please be consistent!) Can you check if there's a need to update the docs? If there is, send me a doc patch and I'll apply it. |
Hmm, I'll remember consistency when working with the C implementation. The Python that I've looked at seems to always use 4 spaces. At any rate, here's a doc patch. It essentially just makes "n bit integers" read "n bit positive integers". Other than that, I can think of no way to update the docs to reflect the scope of this patch. Thanks for everything, Guido! |
Thanks, applied! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: