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

Guido van Rossum guido at python.org
Tue Nov 21 02:24:21 CET 2006

Is there any reason to assume the data size is ever less than the
block size except for the last data block? It's reading from a
pseudo-file tied to a socket, but Python files tend to have the
property that read(n) returns exactly n bytes unless at EOF.

BTW I left a longer comment at SF earlier.

On 11/20/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Fredrik Lundh schrieb:
> > 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.
> Right - such code would break. I believe the code would also break when
> the count is set to zero; I can't see how this would help.
> The question is whether this breakage is a strong enough reason not to
> change the code.
> Regards,
> Martin
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list