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 r.david.murray
Recipients r.david.murray
Date 2015-03-22.19:28:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427052524.74.0.134908492197.issue23740@psf.upfronthosting.co.za>
In-reply-to
Content
While committing the patch for issue 23539 I decided to rewrite the 'request' docs for clarity.  I doing so I found that http.client isn't as consistent as it could be about how it handles bytes and strings.  Two points specifically:  it will only take the length of a bytes-like object (to supply a default Content-Length header) if isinstance(x, bytes) is true (that is, it doesn't take the length of eg array or memoryview objects), and (2) if an iterable is passed in, it must be an iterable of bytes-like objects.  Since it already automatically encodes string objects and text files, for consistency it should probably also encode strings if they are passed in via an iterator.
History
Date User Action Args
2015-03-22 19:28:44r.david.murraysetrecipients: + r.david.murray
2015-03-22 19:28:44r.david.murraysetmessageid: <1427052524.74.0.134908492197.issue23740@psf.upfronthosting.co.za>
2015-03-22 19:28:44r.david.murraylinkissue23740 messages
2015-03-22 19:28:44r.david.murraycreate