[Python-Dev] New test failure, test_socket, WinXP

Guido van Rossum guido at python.org
Tue Jul 6 05:27:01 CEST 2004

> Fails every time, in release and debug builds:
> test test_socket failed -- Traceback (most recent call last):
>   File "C:\Code\python\lib\test\test_socket.py", line 311, in testGetServBy
>     eq(socket.getservbyport(port2), service)
> AssertionError: 'http' != 'www'

Sounds like the Windows equivalent (on your box) of /etc/services is
bogus.  What does the line for 80/tcp look like in
\Wimdows\system32\drivers\etc\services ?  (Well, that's where it is on
my XP box.  Who knows where it is on yours.)

On my box it says approximately:

http  80/tcp   www   www-http         #world wide web

This suggests that it should return "http", not "www" -- unless the
implementaton picks the first alias instead of the official service
name.  (Can't test this yet because I haven't built the latest 2.4 and
apparently this is a very recent addition to the socket module.)

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list