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 demian.brecht
Recipients demian.brecht, martin.panter, orsenthil
Date 2015-01-31.00:45:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
On 2015-01-29 9:51 PM, Martin Panter wrote:
> The documentation currently says “Content-Length header should be explicitly provided when the body is an iterable”. See Lib/urllib/ for how it is done for urlopen(), using memoryview(), which is probabaly more correct.

Sure, entirely disabling computing the content length if the body is an
iterable is one way to address it, but I'm not convinced that it's
better. If the ability is there to compute the content length, why not
do so?

The current implementation /should/ be correct whether elements are
bytes or strings (the default encoding doesn't allow for multi-byte
chars, so len(raw_string) should equal len(encoded_string)) when encoded
using the new block of encoding code I added in the patch.

Is there something that I'm missing? I could possibly see an argument
for performance as you're iterating over each element in the list, but
that would be entirely circumvented if the user defines the content
length up front.
Date User Action Args
2015-01-31 00:45:11demian.brechtsetrecipients: + demian.brecht, orsenthil, martin.panter
2015-01-31 00:45:11demian.brechtlinkissue23350 messages
2015-01-31 00:45:11demian.brechtcreate