This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients akuchling, edemaine, forest_atq, naufraghi, neologix, pitrou, sascha_silbe, schmir
Date 2011-01-12.13:16:22
SpamBayes Score 0.00032021932
Marked as misclassified No
Message-id <1294838187.12.0.385212839178.issue1488934@psf.upfronthosting.co.za>
In-reply-to
Content
This is normal behaviour: stdout is normally line buffered (_IOLBF) only if connected to a tty.
When it's not connected to a tty, it's full buffered (_IOFBF). This is done on purpose for performance reason. To convince yourself, run 

$ cat test.py
for i in range(1, 1000000):
    print('hello world')

$ time python test.py > /tmp/foo

With buffering off (-u option), the same commande takes almost 10 times longer.

If the application wants to be sure to receive a SIGPIPE when the pipe's end is closed, it should just flush stdout explicitely (sys.stdout.flush()).

Suggesting to close.
History
Date User Action Args
2011-01-12 13:16:27neologixsetrecipients: + neologix, akuchling, edemaine, pitrou, schmir, naufraghi, forest_atq, sascha_silbe
2011-01-12 13:16:27neologixsetmessageid: <1294838187.12.0.385212839178.issue1488934@psf.upfronthosting.co.za>
2011-01-12 13:16:22neologixlinkissue1488934 messages
2011-01-12 13:16:22neologixcreate