[issue7540] urllib2 request does not update content length after new add_data

2010-04-27 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- priority: -> normal ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue7540] urllib2 request does not update content length after new add_data

2010-03-10 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: The reverts in SVN look good to me; re-closing this issue as no further action is required. If there's a proposal for specific changes to urllib2 to improve diagnostics in unsupported cases, that should be detailed in a separate issue. Marking this issue

[issue7540] urllib2 request does not update content length after new add_data

2010-03-06 Thread Senthil Kumaran
Senthil Kumaran added the comment: Change is reverted from other branches too. Discussed in IRC, that changes made to an existing API like add_data,may break some existing applications, even if its done to prevent unsupported usage. Specifically, in mechanize's case, it was not reusing req o

[issue7540] urllib2 request does not update content length after new add_data

2010-03-04 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: Reopening; per discussion on IRC, the change needs to be reverted on the other three branches to which it was applied. If code changes are needed to make unsupported usage fail early, they need to be considered carefully and only applied as a new feature.

[issue7540] urllib2 request does not update content length after new add_data

2010-03-04 Thread R. David Murray
R. David Murray added the comment: Fred, I think your report of observed breakage is sufficient to warrant rolling back the change, especially since this isn't an actual bug fix. That is, no code that was failing to work before would be enabled to work by this fix. (Rather, it aims to preve

[issue7540] urllib2 request does not update content length after new add_data

2010-03-03 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I'd like to hear at least one other say-so (which can be yours if you agree this is the right thing), so there's more recognized consensus on the matter. We also need an explicit go-ahead from Barry as the release manager. At this point, the community sees

[issue7540] urllib2 request does not update content length after new add_data

2010-03-03 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: To clarify: Multiple calls to add_data on a urllib2 request, when the request isn't being reused, are in no way invalidated by the problem initially reported. -- ___ Python tracker

[issue7540] urllib2 request does not update content length after new add_data

2010-03-03 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: This change breaks existing uses of Python 2.6.4. The mechanize library frequently re-initializes the data in the request without re-using the request. Applications (including tests) that use mechanize now break with this TypeError. The proper response to

[issue7540] urllib2 request does not update content length after new add_data

2009-12-27 Thread Till Maas
Till Maas added the comment: I do not need to reuse a request object, but I did in a script when only the data was different for each request. If this is not meant to be done, then any not meant to be done modification should somehow create an error, when it is done, instead of silently performi

[issue7540] urllib2 request does not update content length after new add_data

2009-12-27 Thread Pablo Mouzo
Pablo Mouzo added the comment: 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',

[issue7540] urllib2 request does not update content length after new add_data

2009-12-24 Thread Nir Aides
Changes by Nir Aides : -- nosy: +nirai ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/ma

[issue7540] urllib2 request does not update content length after new add_data

2009-12-20 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- assignee: -> orsenthil nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue7540] urllib2 request does not update content length after new add_data

2009-12-18 Thread Till Maas
New submission from Till Maas : 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