Message238928
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. |
|
Date |
User |
Action |
Args |
2015-03-22 19:28:44 | r.david.murray | set | recipients:
+ r.david.murray |
2015-03-22 19:28:44 | r.david.murray | set | messageid: <1427052524.74.0.134908492197.issue23740@psf.upfronthosting.co.za> |
2015-03-22 19:28:44 | r.david.murray | link | issue23740 messages |
2015-03-22 19:28:44 | r.david.murray | create | |
|