A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-November/069992.html below:

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

[Python-Dev] Passing actual read size to urllib reporthook [Python-Dev] Passing actual read size to urllib reporthook"Martin v. Löwis" martin at v.loewis.de
Tue Nov 21 06:56:20 CET 2006
Guido van Rossum schrieb:
> 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.

Right: socket._fileobject will invoke recv as many times as
necessary to read the requested amount of data. I was somehow
assuming that it maps read() to read(2), which, in turn, would
directly map to recv(2), which could return less data.

So it's a semantic change only for the last block.

Regards,
Martin

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4