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 amaury.forgeotdarc
Recipients amaury.forgeotdarc, eggy, habnabit, ironfroggy
Date 2008-12-08.10:19:54
SpamBayes Score 0.00011697759
Marked as misclassified No
Message-id <1228731597.59.0.0535729970205.issue4579@psf.upfronthosting.co.za>
In-reply-to
Content
Python 2 is very platform-dependent: fdopen simply call the C function
fdopen() and returns a FILE*.
Since the sample code is a mistake (read on a file open in write mode),
how and when the error shows up really depends on the platform's
implementation of the FILE* object.

On the other hand Python 3 re-implemented all this, no FILE is used. The
io.UnsupportedOperation("BufferedWriter.read() not supported") is much
better IMO. And note that io.UnsupportedOperation is a IOError as well.

However the AttributeError is inconsistent. The attached patch turns it
into a UnsupportedOperation as above.
History
Date User Action Args
2008-12-08 10:19:57amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, ironfroggy, habnabit, eggy
2008-12-08 10:19:57amaury.forgeotdarcsetmessageid: <1228731597.59.0.0535729970205.issue4579@psf.upfronthosting.co.za>
2008-12-08 10:19:56amaury.forgeotdarclinkissue4579 messages
2008-12-08 10:19:56amaury.forgeotdarccreate