Message238928
| 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: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 |
|