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 tholzer
Recipients loewis, tholzer
Date 2010-02-15.21:03:43
SpamBayes Score 1.3534082e-09
Marked as misclassified No
Message-id <1266267825.51.0.71658913414.issue7932@psf.upfronthosting.co.za>
In-reply-to
Content
This is not quite correct:

The following 2 lines fail as expected (unbuffered):

<pre>
python -u -c 'import sys; print >> sys.stdout, "x"' 1>&- ; echo $?
python -u -c 'import sys; print >> sys.stderr, "x"' 2>&- ; echo $?
</pre>

whereas in the following example, the first command succeeds and the second one fails:

<pre>
python -c 'import sys; print >> sys.stdout, "x"' 1>&- ; echo $?
python -c 'import sys; print >> sys.stderr, "x"' 2>&- ; echo $?
</pre>

This is counter-intuitive and somewhat contradicts the documentation, as stderr always seems to be unbuffered (irrespective of the -u option). IMHO, they should either both fail or both succeed.

They seem to behave the same in 2.5 & 2.6, however in 3.1, they all die with a SIGABRT, which I guess could be questioned as well. IMHO, they should just throw an exception like in 2.6.
History
Date User Action Args
2010-02-15 21:03:45tholzersetrecipients: + tholzer, loewis
2010-02-15 21:03:45tholzersetmessageid: <1266267825.51.0.71658913414.issue7932@psf.upfronthosting.co.za>
2010-02-15 21:03:44tholzerlinkissue7932 messages
2010-02-15 21:03:43tholzercreate