Skip to content
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

Closed
mark-roberts mannequin opened this issue Jan 14, 2007 · 4 comments
Closed

htonl et al accept negative ints #44462

mark-roberts mannequin opened this issue Jan 14, 2007 · 4 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mark-roberts
Copy link
Mannequin

mark-roberts mannequin commented Jan 14, 2007

BPO 1635058
Nosy @gvanrossum
Files
  • bug_1619659.patch: patch modifying Modules/socketmodule.c and Lib/test/test_socket.py
  • bug_g119659_doc.patch: doc patch
  • 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:

    assignee = None
    closed_at = <Date 2007-01-15.00:02:49.000>
    created_at = <Date 2007-01-14.07:35:49.000>
    labels = ['interpreter-core']
    title = 'htonl et al accept negative ints'
    updated_at = <Date 2007-01-15.00:02:49.000>
    user = 'https://bugs.python.org/mark-roberts'

    bugs.python.org fields:

    activity = <Date 2007-01-15.00:02:49.000>
    actor = 'gvanrossum'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2007-01-14.07:35:49.000>
    creator = 'mark-roberts'
    dependencies = []
    files = ['7718', '7719']
    hgrepos = []
    issue_num = 1635058
    keywords = ['patch']
    message_count = 4.0
    messages = ['51737', '51738', '51739', '51740']
    nosy_count = 2.0
    nosy_names = ['gvanrossum', 'mark-roberts']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1635058'
    versions = ['Python 2.6']

    @mark-roberts
    Copy link
    Mannequin Author

    mark-roberts mannequin commented Jan 14, 2007

    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.

    @mark-roberts mark-roberts mannequin closed this as completed Jan 14, 2007
    @mark-roberts mark-roberts mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 14, 2007
    @mark-roberts mark-roberts mannequin closed this as completed Jan 14, 2007
    @mark-roberts mark-roberts mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jan 14, 2007
    @gvanrossum
    Copy link
    Member

    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.

    @mark-roberts
    Copy link
    Mannequin Author

    mark-roberts mannequin commented Jan 14, 2007

    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

    @gvanrossum
    Copy link
    Member

    Thanks, applied!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant