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
socket functions that should return unsigned int return signed int #46052
Comments
Socket library functions such as ntohs() return uint16_t, but inside struct.unpack('H', struct.pack('h', ntohs(number)))[0] & 0xffff |
Which number shows up as a negative number on your system? |
Numbers returned from ntohs() turn up as negative. But ntohs() is typed as |
Please provide an example number |
Try this on Linux and Solaris: from socket import ntohs, htons print ntohs(htons(55000)) On Linux: On Solaris: |
This should be fixed. Maarten, can you create a patch that works for |
Guido, the problem is that my python foo is severely lacking - but I'll Python believes that the number coming back from the C library is |
Maarten, can you build Python 2.6 from svn? (See It looks like this has been fixed there, per r53434. Perhaps the same |
Maarten: Do you have time to try doing a test build as suggested by |
This is likely fixed; setting the status to pending and priority to low. |
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: