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 pablomouzo
Recipients nirai, orsenthil, pablomouzo, till
Date 2009-12-27.17:18:17
SpamBayes Score 0.02085719
Marked as misclassified No
Message-id <1261934300.42.0.948657793798.issue7540@psf.upfronthosting.co.za>
In-reply-to
Content
The problem here is that the headers are not updated if they already 
exists. The solution is quite simple but breaks the tests because it 
"clobbers the existing headers".

You can do this:
...
req.add_data(some_data)
req.add_unredirected_header('Content-Length', len(some_data))
urllib2.urlopen(req)
...

But is risky because all the other headers are still outdated.

Is there any reason why you need to reuse the request object?
History
Date User Action Args
2009-12-27 17:18:20pablomouzosetrecipients: + pablomouzo, orsenthil, nirai, till
2009-12-27 17:18:20pablomouzosetmessageid: <1261934300.42.0.948657793798.issue7540@psf.upfronthosting.co.za>
2009-12-27 17:18:18pablomouzolinkissue7540 messages
2009-12-27 17:18:18pablomouzocreate