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

"Martin v. Löwis" martin at v.loewis.de
Sun Nov 19 11:58:37 CET 2006


Patch #849407 proposes to change the meaning of the
urllib reporthook so that it takes the amount of the
data read instead of the block size as its second
argument.

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.

What do you think?

Regards,
Martin


More information about the Python-Dev mailing list