akira added the comment:
Summary: It is a new behavior. There is no need to change either code or
docs. Though docs could be clarified to be more explicit.
The behavior has been introduced only in 3.3 in revision 53715804dc71
 from issue 10050 
It knownly breaks backward-compatibility. The docstring says:
> The reporthook argument should be a callable that accepts a block
> number, a read size, and the total file size of the URL target.
The change was rejected in issue 849407 
Though it is not mentioned in Misc/NEWS and
Doc/library/urllib.request.rst doesn't mention the change from a static
block size to a read size explicitly:
> The third argument, if present, is a hook function that will be called
> once on establishment of the network connection and once after each
> block read thereafter. The hook will be passed three arguments; a
> count of blocks transferred so far, a block size in bytes, and the
> total size of the file.
*after each block read* and *block size in bytes* do not suggest that
the block size must be constant. This part in the docs could be more
There is related issue 1490929 
type: -> behavior
versions: -Python 3.1, Python 3.2
Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list