[Patches] [ python-Patches-725942 ] Modules/addrinfo.h patch

SourceForge.net noreply@sourceforge.net
Fri, 25 Apr 2003 12:07:43 -0700


Patches item #725942, was opened at 2003-04-23 01:52
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=725942&group_id=5470

Category: Modules
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: David Wood (woodd)
Assigned to: Nobody/Anonymous (nobody)
Summary: Modules/addrinfo.h patch

Initial Comment:
I've compiled / linked Python 2.2.2 on Solaris 2.6 for 
both of my Solaris releases (Solaris 2.6 & Solaris 8).  
Python works fine on Solaris 2.6; however, on Solaris 
2.8 I get the following:

  File "/usr/local/lib/python2.2/SocketServer.py", line 
340, in server_bind
    self.socket.bind(self.server_address)
  socket.gaierror: (3, 'getaddrinfo failed')

Solaris 2.6 does not have getaddrinfo but Solaris 8 
does.  The failure occurs on Solaris 8 because Python 
finds getaddrinfo in /usr/lib/libsocket.so 
before /usr/local/lib/python2.2/lib-dynload/_socket.so.  
The return code of 3 (EAI_BADFLAGS) is a result of 
ai_flags mismatch:

  bsqa1.nyc:/u/woodd > grep 'define.AI_PASSIVE' 
Python-2.2.2/Modules/addrinfo.h
  #define AI_PASSIVE      0x00000001 /* get address to 
use bind() */

  bsqa1.nyc:/u/woodd > 
grep 'define.AI_PASSIVE' /usr/include/netdb.h
  #define AI_PASSIVE      0x0008  /* intended for bind() 
+ listen() */

The enclosed patch is simple: always "#define 
getaddrinfo fake_getaddrinfo" if we don't have 
getaddrinfo.  The same applies for getnameinfo.  The 
enclosed patch is against v2.2.2 Modules/addrinfo.h.  
David


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

>Comment By: Martin v. L÷wis (loewis)
Date: 2003-04-25 21:07

Message:
Logged In: YES 
user_id=21627

I'm not sure I want to support this. Shouldn't you build two 
installations of Python instead?

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

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