C:\>python -i -u Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> print 1 File "", line 1 print 1 ^ SyntaxError: invalid syntax >>> ...and this behaviour continues, no mater what statement you enter.
Logged In: YES user_id=31435 Why do you call this a bug? -u forces stdin into binary mode, and the Python grammar does not allow \r\n line endings in program text (it never has, BTW). Program text has to come from a file opened in text mode on Windows, and what you're seeing here is the same as what you'd see if you did f = open('some_python_program.py', 'rb') exec f.read() on Windows.
Logged In: YES user_id=24723 -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x) Hmmm... never noticed the binary bit before. Is there any way to get unbuffered output without it being binary?
Logged In: YES user_id=31435 The only way on Windows is to open a file yourself in text mode with buffer size 0, and either write to it directly, or set sys.stdout to it.