[New-bugs-announce] [issue16409] urlretrieve regression: first call returns block size as 0

anatoly techtonik report at bugs.python.org
Sun Nov 4 23:27:05 CET 2012


New submission from anatoly techtonik:

Renamed urllib.urlretrieve changed behaviour in Py3k, which leads to ZeroDivisionErrors in applications that use block_size parameter for calculations. Previously, block size was constant. Now it varies making it impossible to exactly calculate value transferred so far. Test file attached.


C:\Python33\python.exe test.py
0 0 59654
1 8192 59654
2 8192 59654
3 8192 59654
4 8192 59654
5 8192 59654
6 8192 59654
7 8192 59654
8 2310 59654

C:\Python27\python.exe test.py
(0, 8192, 59654)
(1, 8192, 59654)
(2, 8192, 59654)
(3, 8192, 59654)
(4, 8192, 59654)
(5, 8192, 59654)
(6, 8192, 59654)
(7, 8192, 59654)
(8, 8192, 59654)

----------
components: Library (Lib)
files: test.py
messages: 174836
nosy: techtonik
priority: normal
severity: normal
status: open
title: urlretrieve regression: first call returns block size as 0
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27886/test.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16409>
_______________________________________


More information about the New-bugs-announce mailing list