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 tholzer
Date 2010-02-15.01:04:05
SpamBayes Score 4.1493864e-11
Marked as misclassified No
Message-id <1266195907.59.0.6287236457.issue7932@psf.upfronthosting.co.za>
In-reply-to
Content
When printing to a closed stdout file descriptor, the print statement only raises an IOError at character 8192. 

The expected behaviour is that IOError gets raised immediately (i.e. on the first character). Compare this behaviour to writing to a closed sys.stderr.

To reproduce (using bash):

<pre>
# python -V
Python 2.6.4

# python -c 'print "x" * 8191' 1>&- ; echo $?
close failed in file object destructor:
Error in sys.excepthook:

Original exception was:
0

# python -c 'print "x" * 8192' 1>&- ; echo $?
Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 9] Bad file descriptor
1
</pre>
History
Date User Action Args
2010-02-15 01:05:08tholzersetrecipients: + tholzer
2010-02-15 01:05:07tholzersetmessageid: <1266195907.59.0.6287236457.issue7932@psf.upfronthosting.co.za>
2010-02-15 01:04:07tholzerlinkissue7932 messages
2010-02-15 01:04:05tholzercreate