[Python-Dev] Passing actual read size to urllib reporthook (original) (raw)

Fredrik Lundh fredrik at pythonware.com
Mon Nov 20 13:20:01 CET 2006


Martin v. Löwis wrote:

While this is a behavior change (and even for explicitly-documented behavior), I still propose to apply the change: - in many cases, the number of bytes read will equal to the block size, so no change should occur - the signature (number of parameters) does not change, so applications shouldn't crash because of that change - applications that do use the parameter to estimate total download time now get a better chance to estimate since they learn about short reads.

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.



More information about the Python-Dev mailing list