<div>Posting to python-dev as it is no more relates to the idea of improving print().</div><div><br></div><div><br></div>sys.stdout.write() in Python 3 causes backwards incompatible behavior that breaks recipe for unbuffered character reading from stdin on Linux - <a href="http://code.activestate.com/recipes/134892/" target="_blank">http://code.activestate.com/recipes/134892/</a>  At first I though that the problem is in the new print() function, but it appeared that the culprit is sys.stdout.write()<div>

<br></div><div>Attached is a test script which is a stripped down version of the recipe above.<div>
<br></div><div>If executed with Python 2, you can see the prompt to press a key (even though output on Linux is buffered in Python 2).</div><div><div>With Python 3, there is not prompt until you press a key.</div><div>
<br></div><div>Is it a bug or intended behavior? What is the cause of this break?</div><div>-- </div><div><div>anatoly t.<br><br></div></div></div>
</div>