title: Python "print" causes threading deadlock
body: <p>I have a large system with workers and manager threads.</p>
  
  <p>I have run into the problem that one of the threads uses:</p>
  
  <pre><code>print "before time sleep"
  time.sleep(5)
  print "after time sleep"
  </code></pre>
  
  <p>It will print both a lot of times and then suddenly only display "before time sleep"
  And stop until i kill all the other threads.
  None of the other threads are stopping.</p>
  
  <p>I think some other part of the code is locking the commandline output or something like that, but I have no idea how to find the spot (it can take up to 24 hours before it happens)</p>
  
  <p>I'm using python 2.7 and the error occurs on a windows server. </p>