print(....,file=sys.stderr) buffered?

Helmut Jarausch jarausch at skynet.be
Mon Aug 13 11:16:17 EDT 2012


Hi,

for tracing purposes I have added some print outs like

print('+++ before calling foo',file=sys.stderr)
x=foo(..)
print('--- after  calling foo',

and within 'foo'
print('>>> entering foo ...',file=sys.stderr)

Now, when executing this, I always get

+++ before calling foo
--- after  calling foo
>>> entering foo ...

When outputting to stderr from C/C++ it's guaranteed that the different 
outputs appear in the same order as they have been generated.

Is this guarantee no more valid in Python 3.2 ?

Many thanks for a comment,
Helmut.

(That's a single-threaded application)




More information about the Python-list mailing list