[issue1711] socket functions that should return unsigned int return signed int

Maarten Thibaut report at bugs.python.org
Tue Jan 1 22:40:08 CET 2008


Maarten Thibaut added the comment:

Guido, the problem is that my python foo is severely lacking - but I'll
have a stab at it.

Python believes that the number coming back from the C library is
negative. We can fool it by packing the "signed short" into a
system-native format, and then unpacking it explicitly into an unsigned
short. So I propose to do precisely that on big endian systems using
sys.byteorder: wrap these functions with a converter. Would that be
acceptible?

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1711>
__________________________________


More information about the Python-bugs-list mailing list