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

SourceForge.net noreply@sourceforge.net
Mon, 07 Jul 2003 07:03:55 -0700


Bugs item #767150, was opened at 2003-07-07 16:03
Message generated for change (Tracker Item Submitted) made by Item Submitter
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



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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=767150&group_id=5470