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 orsenthil
Recipients William.Wu, georg.brandl, orsenthil
Date 2011-02-02.09:13:34
SpamBayes Score 0.03650929
Marked as misclassified No
Message-id <AANLkTi=j_f9uryuvb=oNC_xhx4zFNC_LLJxxC0sWLV4N@mail.gmail.com>
In-reply-to <1296635786.4.0.46974786955.issue11082@psf.upfronthosting.co.za>
Content
The POST data should be bytes. So in the attached test case, instead of

request = urllib.request.Request('http://does.not.matter', 'foo=bar')

it should be:

request = urllib.request.Request('http://does.not.matter', b'foo=bar')

And the Content-Length will be calculated using this logic.

mv = memoryview(data)
Content-length = len(mv) * mv.itemsize

Should we emphasize further that data should be bytes? I think error
message can be improved here.  This issue is not a blocker.
History
Date User Action Args
2011-02-02 09:13:34orsenthilsetrecipients: + orsenthil, georg.brandl, William.Wu
2011-02-02 09:13:34orsenthillinkissue11082 messages
2011-02-02 09:13:34orsenthilcreate