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, mdehoon, pitrou
Date 2012-12-19.09:55:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1355910914.8.0.276410621595.issue16723@psf.upfronthosting.co.za>
In-reply-to
Content
Hum, io objects are not supposed to close themselves when they run out of data.
Even if HTTPResponse chooses to close the underlying socket (to clean unused resources?), it should not report itself as a closed io.IOBase.
Subsequent calls read() should return b"", this is the io.RawIOBase way to indicate EOF.

To fix this particular example, it seems enough to delete the "@property def closed(self)" from HTTPResponse. Note the XXX just above:
"""
    # XXX This class should probably be revised to act more like
    # the "raw stream" that BufferedReader expects.
"""
But close() should be modified as well, and internal calls to close() should be changed to only close the underlying socket.
History
Date User Action Args
2012-12-19 09:55:14amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, mdehoon, pitrou
2012-12-19 09:55:14amaury.forgeotdarcsetmessageid: <1355910914.8.0.276410621595.issue16723@psf.upfronthosting.co.za>
2012-12-19 09:55:14amaury.forgeotdarclinkissue16723 messages
2012-12-19 09:55:13amaury.forgeotdarccreate