classification
Title: urllib.request.urlretrieve never raises ContentTooShortError if no reporthook
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: orsenthil Nosy List: RC, nailor, orsenthil, python-dev, siemer
Priority: normal Keywords: patch

Created on 2011-01-03 15:50 by RC, last changed 2011-10-31 18:48 by nailor. This issue is now closed.

Files
File name Uploaded Description Edit
issue10817.patch nailor, 2011-10-18 16:02 review
Messages (7)
msg125186 - (view) Author: Robert Cheng (RC) Date: 2011-01-03 15:50
When reporthook is None, size variable is not computed and defaulted to -1. Thus, without reporthook, ContentTooShortError is not raised even when Content-Length header is supplied and download size is less than expected amount, contrary to the documentation.
msg145807 - (view) Author: Jyrki Pulliainen (nailor) * Date: 2011-10-18 13:26
Changed the code so that the content length is set as size if reporthook is not set and wrote two tests for it.

Note: I moved fakehttp behavior to a mixin, so that it's more reusable.
msg145826 - (view) Author: Jyrki Pulliainen (nailor) * Date: 2011-10-18 16:02
I had a bad patch, containing changes to locale.py, so I've uploaded a new patch for this.
msg146721 - (view) Author: Roundup Robot (python-dev) Date: 2011-10-31 17:40
New changeset 2ca415cbf2ac by Senthil Kumaran in branch '3.2':
Fix issue 10817 - Fix urlretrieve function to raise ContentTooShortError
http://hg.python.org/cpython/rev/2ca415cbf2ac

New changeset e3e5b6f03f79 by Senthil Kumaran in branch 'default':
merge from 3.2 - Fix issue 10817 - Fix urlretrieve function to raise ContentTooShortError
http://hg.python.org/cpython/rev/e3e5b6f03f79
msg146726 - (view) Author: Roundup Robot (python-dev) Date: 2011-10-31 18:45
New changeset 1ef30d6429db by Senthil Kumaran in branch '2.7':
Port to 2.7 - issue 10817 - Fix urlretrieve function to raise
http://hg.python.org/cpython/rev/1ef30d6429db
msg146727 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2011-10-31 18:46
This is fixed in all codelines. Thanks for your contribution, Jyrki Pulliainen.
msg146728 - (view) Author: Jyrki Pulliainen (nailor) * Date: 2011-10-31 18:48
Cheers, thank you for commiting!
History
Date User Action Args
2011-10-31 18:48:41nailorsetmessages: + msg146728
2011-10-31 18:46:31orsenthilsetstatus: open -> closed
resolution: fixed
messages: + msg146727

versions: + Python 3.2, Python 3.3
2011-10-31 18:45:24python-devsetmessages: + msg146726
2011-10-31 17:40:15python-devsetnosy: + python-dev
messages: + msg146721
2011-10-18 16:02:39nailorsetfiles: - issue10817.patch
2011-10-18 16:02:23nailorsetfiles: + issue10817.patch

messages: + msg145826
2011-10-18 13:26:59nailorsetfiles: + issue10817.patch

nosy: + nailor
messages: + msg145807

keywords: + patch
2011-01-15 00:10:47siemersetnosy: + siemer
2011-01-03 15:53:07orsenthilsetassignee: orsenthil

nosy: + orsenthil
2011-01-03 15:50:00RCcreate