[Python-Dev] New test failure, test_socket, WinXP
Guido van Rossum
guido at python.org
Tue Jul 6 06:39:17 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'
>
> [Brett C.]
> > Does it pass if you change "www" to "http" on line 292?
>
> Yup! I'm not going to check that in, though -- I don't really know what
> this test is doing.
If on some platforms getservbyport(80) returns 'http' and on others
'www', the test should rely on neither. Technically speaking, 'http'
is right and 'www' is wrong (there's no protocol named 'www'), but if
that's what a platform's getservbyport(80) returns, and if
socket.getservbyport() is supposed to be (as I hope) a simple wrapper
around the platform's getservbyport(), then we shouldn't be testing
specific values of the platform's function.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list