[Pythonmac-SIG] test_socket failed

Jack Jansen jack@oratrix.nl
Thu, 20 Jul 2000 10:16:40 +0200


> I ran test_all and test_socket failed. So I ran test_socket by itself to
> get more info and it says 'hostname not found' when it gets to the line
> 
> hname, aliases, ipaddrs = socket.gethostbyaddr(ip)

Your nameserver is broken. The three calls in the test script are
	hostname = socket.gethostname()
	ip = socket.gethostbyname(hostname)
	hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
and only the final one, which does the reverse lookup on your IP address, 
apparently fails. The various RFC standards specify that for each IP address 
the reverse mapping should always work.

As an aside, you'll also have trouble accessing ftp.cwi.nl to load a new 
MacPython (as that machine uses reverse mapping as part of its anti-abuse 
policy).


> Eventually I will need to embed this into a C program, or extend the
> script to use some C functions to do another task. I have CodeWarrior
> 2.0b3, IDE 4.0 and (Mac)Python 1.5.2.

Yes, that's fine. Look at the xx module for an example project and such.
Hmm, I do seem to remember that something reasonably serious was fixed in this 
area, so maybe you should try MacPython 1.6alfa, from 
http://www.cwi.nl/ftp/jack/python/mac .

> I have the CWGUSI (I'm not sure it applies here, but I'm also curious
> as to what this does, in relation to Python in particular). I've read
> through much of the documentation and the whole FAQ, so any help you can
> give would be appreciated. Thanks.

You probably won't need CWGUSI, you'll just need to remove it from the access 
path of your module project (it was there inadvertantly). Unless you use 
socket(), select(), stat() or another unix-compatible I/O call from within 
your extension module.
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm