[ python-Bugs-767150 ] socket.inet_aton on 64bit platform
SourceForge.net
noreply at sourceforge.net
Thu Aug 12 18:45:20 CEST 2004
Bugs item #767150, was opened at 2003-07-07 08:03
Message generated for change (Comment added) made by mwichmann
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=767150&group_id=5470
Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Geert Jansen (geertj)
Assigned to: Nobody/Anonymous (nobody)
Summary: socket.inet_aton on 64bit platform
Initial Comment:
Hi,
socket.inet_aton() returns an 8 byte string when built
on Linux/IA64. This should be 4 bytes on all
architectures. Example:
>>> import socket
>>> socket.inet_aton('192.168.2.1')
'\xc0\xa8\x02\x01\x00\x00\x00\x00'
The bug is caused by Modules/socketmodule.c using
sizeof(unsinged long) when constructing the string,
which is 8 bytes on Linux/IA64.
The bug seems to be fixed in Python 2.3 in the case
struct in_addr is available. Otherwise it still uses an
unsigned long.
Geert
----------------------------------------------------------------------
Comment By: Mats Wichmann (mwichmann)
Date: 2004-08-12 10:45
Message:
Logged In: YES
user_id=53605
I've just run into this problem, which is still present in
current cvs. This now (2.3.x and cvs head) occurs for the
code path where inet_aton is not detected by configure, so
it's not a terribly common case. Of course, I have one ...
The conversion needs to be done on a 32-bit quantity. It's
a one-liner to fix, I'll submit a patch if I can make the
patch manager work for me.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2003-07-07 15:10
Message:
Logged In: YES
user_id=21627
Can you try to come up with a patch?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=767150&group_id=5470
More information about the Python-bugs-list
mailing list