title: Weird select error in python
body: <p>Ok, so I have Python 2.5 and Windows XP. I was using select.select with a socket object. I tried it again and again, but whenever I run it, the thread it is in gives me an error like select.error(9, "Bad file descriptor").
  The code is something like this:</p>
  
  <pre><code>import socket, select
  s = socket.socket()
  s.bind((socket.gethostbyname(socket.gethostname()), 1312))
  s.listen(5)
  inputs = [s]
  outputs = []
  while True:
      r, w, e = select.select(inputs, outputs, inputs)
      for sock in r:
          if sock is s:
              inputs.append(s.accept()[0])
          else:
              print s
              print s.recv(1024)
  </code></pre>
  
  <p>Any info would be appreciated. Thanks!</p>