[Python-Dev] Passing actual read size to urllib reporthook

Scott Dial scott+python-dev at scottdial.com
Tue Nov 21 00:23:59 CET 2006


Fredrik Lundh wrote:
> haven't used the reporthook, but my reading of the documentation would have led me
> to believe that I should do count*blocksize to determine how much data I've gotten this
> far.  changing the blocksize without setting the count to zero would break such code.
> 
> </F> 
> 

I'm not sure where the error in your reading happened, but I read the 
docs and got the same thing out of it except that there is no problem 
with Martin's change. This API doesn't seem to make much sense anyways 
because who is going to be interested in the count? Fixing the count to 
one always and setting blocksize to the actual amount of data makes the 
most sense in recovering this API.

The only potential problem is if there is a non-null answer to "who is 
going to be interested in the count?"

-- 
Scott Dial
scott at scottdial.com
scodial at cs.indiana.edu


More information about the Python-Dev mailing list