[pypy-dev] select/test_readable on Win32 blocks forever

Amaury Forgeot d'Arc amauryfa at gmail.com
Thu Jul 5 15:28:21 CEST 2007

Hello Scott,

Scott Dial wrote:
> Greetings,
> I haven't figured this one out. As the subject says, test_readable for
> the select module gets stuck forever. If I trust the history of the bot,
> then it appeared somewhere after r44639 and before r44646. I've looked
> through the revisions and nothing jumped out at me.. happy hunting to
> someone more aware of the changes.

When I wrote these tests a few months ago, they passed on the two
windows machines where I ran them (Win2k + python2.5 behind a
firewall, and XP + python2.4 at home).
They still pass without problem (except for some network operations
forbidden by the firewall).
Is it possible that the bot runs in a restricted environment? What is
the configuration of this machine?

I suggest to run the following test function, either alone, or
somewhere in the test suite Could you put it near the top of
pypy/module/select/test/test_select.py ?
It has nothing to do with pypy, but repeats the same test at the python level.

# Sanity check of the standard Python interpreter
def test_CPython_select():
    import thread, socket, select
    sock = socket.socket()
    try_ports = [1023] + range(20000, 30000, 437)

    for port in try_ports:
        print 'binding to port %d:' % (port,),
        sockaddress = ('', port)
            print 'works'
        except socket.error, e:
            print e
            raise e
        assert False, "Could not create server"

    writeend = socket.socket()
    thread.start_new_thread(writeend.connect, (sockaddress,))
    readend, addr2 = sock.accept()

        iwtd, owtd, ewtd = select.select([readend], [], [], 0)
        assert iwtd == owtd == ewtd == []
        iwtd, owtd, ewtd = select.select([readend], [], [])
        assert iwtd == [readend]
        assert owtd == ewtd == []
        print "Test OK"

Amaury Forgeot d'Arc

More information about the Pypy-dev mailing list