[issue28332] silent truncations in socket.htons and socket.ntohs

2017-08-17 Thread Oren Milman
Changes by Oren Milman : -- title: Deprecated silent truncations in socket.htons and socket.ntohs. -> silent truncations in socket.htons and socket.ntohs ___ Python tracker

[issue28332] silent truncations in socket.htons and socket.ntohs

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +929 ___ Python tracker ___ ___

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for you contribution Oren. Rules for promotion unsinged integers to signed integers are not simple. I changed PyLong_FromLong() to PyLong_FromUnsignedLong() for the clarity. -- resolution: -> fixed stage: patch review -> resolved status:

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3da460ca854b by Serhiy Storchaka in branch 'default': Issue #28332: Deprecated silent truncations in socket.htons and socket.ntohs. https://hg.python.org/cpython/rev/3da460ca854b -- nosy: +python-dev ___

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-02 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file44923/patchedCPythonTestOutput_ver2.txt ___ Python tracker ___

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-02 Thread Oren Milman
Oren Milman added the comment: Thanks for the review :) I changed some stuff, according to your comments (and replied to one comment in Rietveld). Version2 diff and test output are attached. -- Added file: http://bugs.python.org/file44922/issue28332_ver2.diff

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Looks reasonable. ntohl() and htonl() already raise an exception if the argument exceeds 32 bit. Added comments on Rietveld. -- nosy: +serhiy.storchaka stage: -> patch review ___ Python tracker

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-01 Thread Oren Milman
Changes by Oren Milman : -- keywords: +patch Added file: http://bugs.python.org/file44913/issue28332_ver1.diff ___ Python tracker ___

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-01 Thread Oren Milman
Changes by Oren Milman : Added file: http://bugs.python.org/file44912/patchedCPythonTestOutput_ver1.txt ___ Python tracker ___

[issue28332] silent truncations in socket.htons and socket.ntohs

2016-10-01 Thread Oren Milman
New submission from Oren Milman: current state Due to the implementation of socket_htons (in Modules/socketmodule.c), in case the received integer does not fit in 16-bit unsigned integer, but does fit in a positive C int, it is silently truncated to 16-bit unsigned