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 martin.panter
Recipients BreamoreBoy, benjamin.peterson, dwight.guth, hynek, martin.panter, pitrou, stutzbach
Date 2015-08-06.03:07:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438830420.89.0.488430810445.issue18082@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation <https://docs.python.org/dev/library/io.html#io.IOBase> says “. . . calling any method (even inquiries) on a closed stream is undefined. Implementations may raise ValueError”. So IMO you shouldn’t rely on any particular success or failure behaviour of these methods when a stream is closed.

Having the stream methods waste time calling out to Python methods and descriptors like readable() and “closed” all the time can make things unnecessarily slow and inefficient (see my work at the end of Issue 18003 for example). On the other hand, removing the existing checks could potentially break someone’s code. I suggest closing this, unless someone has a specific proposal or reason to change.
History
Date User Action Args
2015-08-06 03:07:01martin.pantersetrecipients: + martin.panter, pitrou, benjamin.peterson, stutzbach, BreamoreBoy, hynek, dwight.guth
2015-08-06 03:07:00martin.pantersetmessageid: <1438830420.89.0.488430810445.issue18082@psf.upfronthosting.co.za>
2015-08-06 03:07:00martin.panterlinkissue18082 messages
2015-08-06 03:07:00martin.pantercreate