This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: htonl et al accept negative ints
Type: Stage:
Components: Interpreter Core Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, mark-roberts
Priority: normal Keywords: patch

Created on 2007-01-14 07:35 by mark-roberts, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
bug_1619659.patch mark-roberts, 2007-01-14 07:35 patch modifying Modules/socketmodule.c and Lib/test/test_socket.py
bug_g119659_doc.patch mark-roberts, 2007-01-14 22:24 doc patch
Messages (4)
msg51737 - (view) Author: Mark Roberts (mark-roberts) Date: 2007-01-14 07:35
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.

msg51738 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-01-14 17:04
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.
msg51739 - (view) Author: Mark Roberts (mark-roberts) Date: 2007-01-14 22:24
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!
File Added: bug_g119659_doc.patch
msg51740 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-01-15 00:02
Thanks, applied!
History
Date User Action Args
2022-04-11 14:56:22adminsetgithub: 44462
2007-01-14 07:35:49mark-robertscreate