classification
Title: httplib.HTTPConnection._send_request should not blindly assume dicts for headers
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: open Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: ludvig.ericson, piotr.dobrogost, terry.reedy
Priority: normal Keywords: patch

Created on 2008-07-04 00:19 by ludvig.ericson, last changed 2011-12-04 23:00 by piotr.dobrogost.

Files
File name Uploaded Description Edit
httplib.py.diff ludvig.ericson, 2008-07-04 00:19
Messages (2)
msg69234 - (view) Author: toxik (ludvig.ericson) Date: 2008-07-04 00:19
Presently it's impossible to use httplib.HTTPConnection.request and send 
the several headers with the same name. This is because _send_request 
assumes a dict is passed in, or a dict-like interface. Obviously one could 
make a list subclass or some such and give it an iteritems that returns 
itself, but IMHO the solution is to fix httplib.

Attached patch changes the current behavior to using iteritems only if it 
exists, otherwise iterate directly (which would fit with sequences of two-
tuples).
msg107439 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-06-09 23:16
This is a feature request for now old versions. It would have to be reformulated as a feature request for a 3.2 module. I do not see the dict (mapping now?) requirement being changed.
History
Date User Action Args
2011-12-04 23:00:33piotr.dobrogostsetstatus: pending -> open
nosy: + piotr.dobrogost
2010-06-09 23:16:45terry.reedysetstatus: open -> pending

type: enhancement
versions: - Python 2.4, Python 2.3, Python 2.2.3, Python 2.2.2, Python 2.2.1, Python 2.2, Python 2.1.2, Python 2.1.1
nosy: + terry.reedy

messages: + msg107439
resolution: out of date
2008-07-04 00:19:28ludvig.ericsoncreate