classification
Title: http.client refactor
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, demian.brecht, ethan.furman, martin.panter, orsenthil, r.david.murray
Priority: normal Keywords: patch

Created on 2015-01-28 02:04 by demian.brecht, last changed 2015-01-30 00:10 by demian.brecht. This issue is now closed.

Files
File name Uploaded Description Edit
http_proto.patch demian.brecht, 2015-01-28 02:04 review
http_proto_1.patch demian.brecht, 2015-01-28 02:51 review
Messages (8)
msg234866 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-28 02:04
This is an attempt to bring a little more sanity to the http.client module through improvements to the architecture. The overarching intention of the patch is to modularize the HTTP versions, providing the following benefits:

* Make each protocol easier to work on independent of one another
* Make integrating future versions easier. This is intended as a stepping stone to integrating support for HTTP 2
* Separation of concerns between connection and application protocol

Immediate issues that this solves:
* Content-Length when a list is passed in. Currently the content length is set to the size of the list rather than the sum of the elements of the list
* Provides a little more user-friendly errors when invalid objects are passed in as header values


Note: This is still in a WIP progress state but shouldn't take much longer to get into a commit-able state. There's some work to be done on deserialization and it's entirely documentation. However, tests are passing so I figured now would be a good time to get initial feedback on the work. In hindsight, a PEP would likely have been best (it was initially intended to be put into httplib3, but I thought I might as well try it as a patch submission given it's largely backwards compatible).
msg234867 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-28 02:06
Note that this patch also depends on Antoine's TransformDict patch in #18986.
msg234868 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-28 02:14
Attaching a file /with/ http.proto this time.
msg234869 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-01-28 03:34
Quantifying "largely" will be important.
msg234896 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-28 15:01
On 2015-01-27 7:34 PM, R. David Murray wrote:
> Quantifying "largely" will be important.

Understandably. In terms of the public API, all changes should be purely
additive and 100% backwards compatible. "largely" is referring to some
of the private API that has been removed (i.e. _output and _send_output)
as they're no longer needed. This should also hold true for upcoming
changes as well.
msg234898 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-01-28 15:41
Although they are private interfaces we may decide we need a deprecation release before dropping them.  Sometimes what we do in cases like this is go ahead and make the changes, but also provide the old methods via a backward-compatible shim and have them emit deprecation warnings.  (I haven't looked at your specific changes, and unfortunately probably won't have time to do so :(
msg234900 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-28 15:54
On 2015-01-28 7:41 AM, R. David Murray wrote:
> Although they are private interfaces we may decide we need a deprecation release before dropping them.  Sometimes what we do in cases like this is go ahead and make the changes, but also provide the old methods via a backward-compatible shim and have them emit deprecation warnings.

That makes sense. If it's decided that's the path that should be
pursued, I'll add them in once the functional/test/doc changes have all
been made. Thanks for the heads up.
msg235006 - (view) Author: Demian Brecht (demian.brecht) * (Python triager) Date: 2015-01-30 00:10
Digging into this more, I've opened up a can of worms that will result in http.client not looking nearly at all like http.client. I'll work this into httplib3 and will open this conversation back up if it gets any traction.
History
Date User Action Args
2015-01-30 00:10:13demian.brechtsetstatus: open -> closed
resolution: rejected
messages: + msg235006
2015-01-28 15:54:48demian.brechtsetmessages: + msg234900
2015-01-28 15:41:16r.david.murraysetmessages: + msg234898
2015-01-28 15:01:29demian.brechtsetmessages: + msg234896
2015-01-28 03:34:12r.david.murraysetnosy: + r.david.murray
messages: + msg234869
2015-01-28 03:14:06martin.pantersetnosy: + martin.panter
2015-01-28 02:52:15ethan.furmansetnosy: + ethan.furman
2015-01-28 02:51:35demian.brechtsetfiles: + http_proto_1.patch
2015-01-28 02:22:42berker.peksagsetnosy: + berker.peksag

stage: patch review
2015-01-28 02:14:44demian.brechtsetmessages: + msg234868
2015-01-28 02:09:36orsenthilsetnosy: + orsenthil
2015-01-28 02:06:28demian.brechtsetmessages: + msg234867
2015-01-28 02:04:56demian.brechtcreate