Issue 4308: repr of httplib.IncompleteRead is stupid (original) (raw)

Issue4308

Created on 2008-11-12 16:41 by cjw296, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
incompleteread.patch cjw296,2008-11-13 07:19
Messages (10)
msg75789 - (view) Author: Chris Withers (cjw296) * (Python committer) Date: 2008-11-12 16:41
The repr of httplib.IncompleteRead contains all the data in the read so far. This is stupid. Consider the download of a 100Mb file which fails after 30Mb. You end up with 90Mb of text in the log entry logged with the python logging framework (eg: logger.error('Something bad happened',exc_info=True) )
msg75796 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-11-12 21:20
Would you like to work on a patch?
msg75814 - (view) Author: Chris Withers (cjw296) * (Python committer) Date: 2008-11-13 07:19
Please find attached a patch against the trunk. I'd really appreciate it if this could get merged to the 2.5 and 2.6 branches too, in case of a future release there.
msg83023 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-03-02 16:34
Can't be applied to 2.5 at this point. I agree it's dumb to report the entire partial read and that reporting just the number of bytes read is a much better solution. Your patch looks fine to me as well, except you call resp.close() twice in test_incomplete_read(). Assigning to Benjamin for application. (He's going to get the merge stuff right. I almost certainly will not.)
msg83024 - (view) Author: Chris Withers (cjw296) * (Python committer) Date: 2009-03-02 16:54
Why can't it be applied to 2.5? No problem with the 2nd resp.close() being removed...
msg83026 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-03-02 17:53
The Python 2.5 branch is closed for bug fixes; no further bug fix releases of Python 2.5 will be made. Only security fixes can be accepted on the 2.5 branch.
msg83030 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-03-02 18:34
Chris> Why can't it be applied to 2.5? Benjamin can correct me if I'm wrong, but I thought the last 2.5 release was the last full release planned. Certainly if another full 2.5 release is in the cards then the patch should go there as well. Skip
msg83031 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-03-02 18:37
Martin> The Python 2.5 branch is closed for bug fixes; no further bug Martin> fix releases of Python 2.5 will be made. Only security fixes can Martin> be accepted on the 2.5 branch. So all Chris has to do to get this applied to 2.5 is craft an exploit based on the current behavior, right? ;-) S
msg83034 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2009-03-02 19:53
> So all Chris has to do to get this applied to 2.5 is craft an exploit based > on the current behavior, right? ;-) Right :-) Of course, security patches should see a much more careful review than regular bug fixes.
msg83043 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2009-03-02 22:42
Applied with a few tweaks in r70107.
History
Date User Action Args
2022-04-11 14:56:41 admin set github: 48558
2009-03-02 22:42:00 benjamin.peterson set status: open -> closedresolution: acceptedmessages: +
2009-03-02 19:53:52 loewis set messages: +
2009-03-02 18:37:08 skip.montanaro set messages: +
2009-03-02 18:34:44 skip.montanaro set messages: +
2009-03-02 17:53:12 loewis set nosy: + loewismessages: +
2009-03-02 16:54:43 cjw296 set messages: +
2009-03-02 16:36:17 skip.montanaro set stage: needs patch -> commit review
2009-03-02 16:34:55 skip.montanaro set assignee: benjamin.petersonmessages: + nosy: + skip.montanaroversions: + Python 3.0, - Python 2.5
2008-11-13 07:19:27 cjw296 set files: + incompleteread.patchkeywords: + patchmessages: + versions: + Python 2.6, Python 2.5
2008-11-12 21:20:46 benjamin.peterson set priority: normalnosy: + benjamin.petersonstage: needs patchmessages: + versions: + Python 3.1, Python 2.7, - Python 2.5, Python 2.5.3
2008-11-12 16:41:13 cjw296 create