output buffering--am I missing something obvious?

Skip Montanaro skip at pobox.com
Fri Apr 4 23:28:44 CEST 2003


    >>> import sys
    >>> sys.stdout.write("foo")
    >>> sys.stdout.flush()
    >>> sys.stdout.write("bar\n")
    bar

    Andrew> What am I missing?

Dunno.  Using either 2.2.2 or CVS on Mac OS X I get this:

>>> import sys
>>> sys.stdout.write("foo")
foo>>> sys.stdout.flush()
>>> sys.stdout.write("bar\n")
bar

I tried using 1.5.2 (!) on a Solaris 8 machine (it's what comes on the
Software Companion CD for Sol8) I get the same results:

>>> import sys
>>> sys.stdout.write("foo")
foo>>> sys.stdout.flush()
>>> sys.stdout.write("bar\n")
bar

Bit rot somewhere?  It certainly shouldn't do that.

Skip





More information about the Python-list mailing list