[Python-Dev] Now test_socket fails

Tim Peters tim.one@comcast.net
Wed, 31 Jul 2002 13:26:12 -0400


What's socket.socket() supposed to do without any arguments?  Can't work on
Windows, because socket.py has

if (sys.platform.lower().startswith("win")
    or (hasattr(os, 'uname') and os.uname()[0] == "BeOS")
    or sys.platform=="riscos"):

    _realsocketcall = _socket.socket

    def socket(family, type, proto=0):
        return _socketobject(_realsocketcall(family, type, proto))


C:\Code\python\PCbuild>python ../lib/test/test_socket.py
Testing for mission critical constants. ... ok
Testing default timeout. ... ERROR
Testing getservbyname(). ... ok
Testing getsockopt(). ... ok
Testing hostname resolution mechanisms. ... ok
Making sure getnameinfo doesn't crash the interpreter. ... ok
testNtoH (__main__.GeneralModuleTests) ... ok
Testing reference count for getnameinfo. ... ok
testing send() after close() with timeout. ... ok
Testing setsockopt(). ... ok
Testing getsockname(). ... ok
Testing that socket module exceptions. ... ok
Testing fromfd(). ... ok
Testing receive in chunks over TCP. ... ok
Testing recvfrom() in chunks over TCP. ... ok
Testing large receive over TCP. ... ok
Testing large recvfrom() over TCP. ... ok
Testing sendall() with a 2048 byte string over TCP. ... ok
Testing shutdown(). ... ok
Testing recvfrom() over UDP. ... ok
Testing sendto() and Recv() over UDP. ... ok
Testing non-blocking accept. ... ok
Testing non-blocking connect. ... ok
Testing non-blocking recv. ... ok
Testing whether set blocking works. ... ok
Performing file readline test. ... ok
Performing small file read test. ... ok
Performing unbuffered file read test. ... ok

======================================================================
ERROR: Testing default timeout.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "../lib/test/test_socket.py", line 273, in testDefaultTimeout
    s = socket.socket()
TypeError: socket() takes at least 2 arguments (0 given)

----------------------------------------------------------------------
Ran 28 tests in 3.190s

FAILED (errors=1)
Traceback (most recent call last):
  File "../lib/test/test_socket.py", line 559, in ?
    test_main()
  File "../lib/test/test_socket.py", line 556, in test_main
    test_support.run_suite(suite)
  File "C:\CODE\PYTHON\lib\test\test_support.py", line 188, in run_suite
    raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "../lib/test/test_socket.py", line 273, in testDefaultTimeout
    s = socket.socket()
TypeError: socket() takes at least 2 arguments (0 given)