title: Python Twisted addReader works in linux but not windows
body: <p>I'm trying to write a client in python 2.7 using Twisted. My code works just fine in linux (debian squeeze), but when I tried it on windows (xp and 7) I got a constant stream of error messages. A screenshot of these messages is <a href="https://i.imgur.com/RjaKx.png" rel="nofollow noreferrer">here</a>.</p>
  
  <p>I have narrowed down the bug and was able to write a very stripped down version of my client that still contains the bug:</p>
  
  <pre><code>from twisted.internet.protocol import Protocol,ClientFactory
  from twisted.protocols.basic import LineReceiver
  from twisted.internet import reactor
  
  class TheClient(LineReceiver):
      def lineReceived(self,line):
          print line
  
      def connectionLost(self,reason):
          reactor.stop()
  
  class TheFactory(ClientFactory):
      protocol = TheClient
  
  class Test(object):
      def doRead(self):
          pass
  
      def fileno(self):
          return 0
  
      def connectionLost(self,reason):
          print 'connection lost'
  
      def logPrefix(self):
          return 'Client'
  
  def main():
      print 'starting'
      test = Test()
      reactor.addReader(test)
      reactor.run()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p>If the line containing 'reactor.addReader(test)' is commented out, I do not get any error messages. If I run this code on linux without commenting out any lines, I do not get any error messages. </p>
  
  <p>I found <a href="https://stackoverflow.com/questions/11443040/python-twisted-stdio-example-on-windows-doesnt-work">this question</a>, I don't think its the same problem, but as expected, it did not function properly on windows. </p>
  
  <p>Is this code correct, and this is a windows bug, or do I have to do things differently for it to work in windows?</p>