classification
Title: httplib.HTTPConnection._send_request should not blindly assume dicts for headers
Type:
Components: Library (Lib) Versions: Python 2.5, 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
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ludvig.ericson
Priority: Keywords: patch

Created on 2008-07-04 00:19 by ludvig.ericson, last changed 2008-07-04 00:19 by ludvig.ericson.

Files
File name Uploaded Description Edit Remove
httplib.py.diff ludvig.ericson, 2008-07-04 00:19
Messages
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).
History
Date User Action Args
2008-07-04 00:19:28ludvig.ericsoncreate