[ python-Bugs-767150 ] socket.inet_aton on 64bit platform

SourceForge.net noreply at sourceforge.net
Mon Mar 21 18:40:18 CET 2005


Bugs item #767150, was opened at 2003-07-07 11:03
Message generated for change (Settings changed) made by facundobatista
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: Closed
>Resolution: Wont Fix
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: Facundo Batista (facundobatista)
Date: 2005-03-21 14:40

Message:
Logged In: YES 
user_id=752496

Deprecated. Reopen only if still happens in 2.3 or newer. 

.    Facundo

----------------------------------------------------------------------

Comment By: Facundo Batista (facundobatista)
Date: 2004-11-11 23:16

Message:
Logged In: YES 
user_id=752496

Please, could you verify if this problem persists in Python 2.3.4
or 2.4?

If yes, in which version? Can you provide a test case?

If the problem is solved, from which version?

Note that if you fail to answer in one month, I'll close this bug
as "Won't fix".

Thank you! 

.    Facundo

----------------------------------------------------------------------

Comment By: Mats Wichmann (mwichmann)
Date: 2004-08-12 13: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 18: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