Title: Python2.4: building '_socket' extension fails with `INET_ADD
Type: behavior Stage: test needed
Components: Extension Modules Versions: Python 2.6
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, anthonybaxter, ggarrett, loewis, stroeder
Priority: normal Keywords:

Created on 2004-12-03 11:16 by stroeder, last changed 2010-08-26 15:23 by BreamoreBoy. This issue is now closed.

Messages (8)
msg60609 - (view) Author: Michael Ströder (stroeder) Date: 2004-12-03 11:16

I'm trying to build Python2.4 on a rather old Debian
Building _socket fails (see below) although I tried to use

configure --disable-ipv6

I've added


to Modules/socketmodule.h which made it work. There
were no problems compiling Python2.2 on the very same

Ciao, Michael.

------------------------------ snip
building '_socket' extension
gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -I. -I/tmp/Python-2.4/./Include
-I/user/W3311/local/include -I/usr/local/include
-I/tmp/Python-2.4/Include -I/tmp/Python-2.4 -c
/tmp/Python-2.4/Modules/socketmodule.c -o build/t
/tmp/Python-2.4/Modules/socketmodule.c: In function
`INET_ADDRSTRLEN' undeclared (first use this function)
/tmp/Python-2.4/Modules/socketmodule.c:3350: (Each
undeclared identifier is reported only once
/tmp/Python-2.4/Modules/socketmodule.c:3350: for each
function it appears in.)
/tmp/Python-2.4/Modules/socketmodule.c:3350: size of
array `ip' has non-integer type 
msg60610 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2004-12-13 13:19
Logged In: YES 

How old a debian release is this? It sounds like it's a just
a broken system header, and I'm not entirely convinced that
adding this to the already-large collection of #ifdefs in
socketmodule is a path to happiness.

msg60611 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-01-06 20:35
Logged In: YES 

There are already a few attempts to define ADDRSTRLEN if it
is missing. Maybe we should just merge them into one, and
define it if it is not defined, independent of the system.
msg60612 - (view) Author: Garry J. Garrett (ggarrett) Date: 2005-04-11 16:00
Logged In: YES 

I have the same problem on Solaris 7.
msg60613 - (view) Author: Garry J. Garrett (ggarrett) Date: 2005-04-11 16:37
Logged In: YES 

I got:

building '_socket' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
-fno-strict-aliasing -I. -I/opt/src/Python-2.4.1/./Include
-I/usr/local/include -I/opt/src/Python-2.4.1/Include
-I/opt/src/Python-2.4.1 -c
/opt/src/Python-2.4.1/Modules/socketmodule.c -o
In file included from
/opt/src/Python-2.4.1/Modules/getnameinfo.c: In function
/opt/src/Python-2.4.1/Modules/getnameinfo.c:173: warning:
implicit declaration of function `inet_ntop'
/opt/src/Python-2.4.1/Modules/getnameinfo.c:174: warning:
comparison between pointer and integer
/opt/src/Python-2.4.1/Modules/getnameinfo.c:206: warning:
comparison between pointer and integer
/opt/src/Python-2.4.1/Modules/socketmodule.c: In function
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
`INET_ADDRSTRLEN' undeclared (first use in this function)
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
(Each undeclared identifier is reported only once
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
for each function it appears in.)
/opt/src/Python-2.4.1/Modules/socketmodule.c:3380: warning:
assignment makes pointer from integer without a cast
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: warning:
unused variable `ip'

My users then see...

# ../ini/tester.ini main
Traceback (most recent call last):
  File "./", line 24, in ?
    import core_engine, core_event, core_action, logger
  File "/etsi/tst/regtester.1.0.0/scripts/",
line 19, in ?
    import time, Queue, sched, copy, string, threading,
asyncore, socket
  File "/usr/local/lib/python2.4/", line 51, in ?
    import socket
  File "/usr/local/lib/python2.4/", line 45, in ?
    import _socket
ImportError: No module named _socket

I try your work-around.  Doesn't help.
msg60614 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-04-11 21:23
Logged In: YES 

Unfortunately, non of us has Solaris 7, so there is little
chance that we are able to develop a patch. Can you provide one?
msg60615 - (view) Author: Garry J. Garrett (ggarrett) Date: 2005-04-12 19:40
Logged In: YES 

I'm a SysAdmin.  My users (programmers) who want this 
version of Python claim to have put this fix in place and it 
works (on a copy I'm sure is squirreled away in someone's 
home directory).  Perhaps the account I'm using doesn't have 
something it needs in LD_LIBRARY_PATH, etc.?
msg114986 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-26 15:23
I don't believe that this can still be a problem.
Date User Action Args
2010-08-26 15:23:03BreamoreBoysetstatus: open -> closed

nosy: + BreamoreBoy
messages: + msg114986

resolution: out of date
2009-02-15 22:34:11ajaksu2setstage: test needed
type: behavior
versions: + Python 2.6, - Python 2.4
2004-12-03 11:16:09stroedercreate