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 Yuri.Bochkarev, agriffis, alanjds, amak, cananian, demian.brecht, icordasc, jcea, jhylton, martin.panter, mhammond, orsenthil, r.david.murray, rbcollins
Date 2015-01-31.12:37:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1422707882.57.0.559412059278.issue3566@psf.upfronthosting.co.za>
In-reply-to
Content
I have changed my opinion of the “peek hack” from <https://bugs.python.org/issue3566#msg231413>. It would be useful when doing non-idempotent requests like POST, to avoid sending a request when we know it is going to fail. I looked into how to implement it so that it works for SSL (which does not support MSG_PEEK), and the neatest solution I could think of would require changing the non-blocking behaviour of BufferedReader.peek(), as described in Issue 13322. So I will leave that for later.

Adding ConnectionClosed.v3.patch; main changes:

* Removed the connection_reused flag to HTTPResponse
* ConnectionClosed raised even for the first request of a connection
* Added HTTPConnection.closed flag, which the user may check before a request to see if a fresh connection will be made, or an existing connection will be reused
* ConnectionClosed now subclasses both BadStatusLine and ConnectionError
* Fixed http.client.__all__ and added a somewhat automated test for it

BTW these patches kind of depend on Issue 5811 to confirm that BufferedReader.peek() will definitely return at least one byte unless at EOF.
History
Date User Action Args
2015-01-31 12:38:02martin.pantersetrecipients: + martin.panter, jhylton, mhammond, jcea, orsenthil, amak, rbcollins, cananian, r.david.murray, alanjds, agriffis, icordasc, demian.brecht, Yuri.Bochkarev
2015-01-31 12:38:02martin.pantersetmessageid: <1422707882.57.0.559412059278.issue3566@psf.upfronthosting.co.za>
2015-01-31 12:38:02martin.panterlinkissue3566 messages
2015-01-31 12:38:02martin.pantercreate