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 harobed, martin.panter, orsenthil, r.david.murray
Date 2015-04-13.07:06:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1428908778.39.0.384538534492.issue12327@psf.upfronthosting.co.za>
In-reply-to
Content
For the record, it looks like there were a few distinct but related problems here:

* Passing any StringIO object as the body is not supported (see <https://docs.python.org/2/library/httplib.html#httplib.HTTPConnection.request>), because no StringIO class implements the fileno() method.

* Passing a Python 2 natively implemented StringIO.StringIO instance triggers the same AttributeError exception as in Issue 15267, incompatibility with TemporaryFile objects.

* Even if HTTPConnection.request() did support calculating Content-Length for StringIO objects, it would still be wrong for chunk-encoded bodies. I think the lower-level endheaders() or send() methods should be used instead. Or see Issue 12319, about adding chunked encoding for request().
History
Date User Action Args
2015-04-13 07:06:18martin.pantersetrecipients: + martin.panter, orsenthil, r.david.murray, harobed
2015-04-13 07:06:18martin.pantersetmessageid: <1428908778.39.0.384538534492.issue12327@psf.upfronthosting.co.za>
2015-04-13 07:06:18martin.panterlinkissue12327 messages
2015-04-13 07:06:17martin.pantercreate