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 till
Recipients till
Date 2009-12-18.15:23:59
SpamBayes Score 0.00019875774
Marked as misclassified No
Message-id <1261149842.32.0.235270861363.issue7540@psf.upfronthosting.co.za>
In-reply-to
Content
When I try to reuse a urllib2.Request object with different post data,
the data itself is updated, but the content length is not. Here is a
simple script to reproduce it on Python 2.5 on Fedora 10 and 2.6 on Arch
Linux:

#!/usr/bin/python
# vim: fileencoding=utf8 
# test with:  echo | socat - tcp4-listen:1111,fork
# Demonstrates bad content length of second request, which should be 2
import urllib2
req = urllib2.Request('http://localhost:1111')
req.add_data("1")
urllib2.urlopen(req)
req.add_data("10")
urllib2.urlopen(req)
History
Date User Action Args
2009-12-18 15:24:02tillsetrecipients: + till
2009-12-18 15:24:02tillsetmessageid: <1261149842.32.0.235270861363.issue7540@psf.upfronthosting.co.za>
2009-12-18 15:24:00tilllinkissue7540 messages
2009-12-18 15:24:00tillcreate