You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Trying to use urlgrabber with a text progress meter fails with "TypeError: '>' not supported between instances of 'NoneType' and 'int'"
Version-Release number of selected component (if applicable):
python3-urlgrabber-4.0.0-4.fc31
How reproducible: Always
Steps to Reproduce:
1.
Run this program:
#!/usr/bin/python3
from urlgrabber.grabber import URLGrabber
from urlgrabber.progress import TextMeter
g = URLGrabber(progress_obj=TextMeter())
g.urlgrab('https://download.fedoraproject.org/pub/fedora/linux/releases/31/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-31-1.9.iso')
(use a different URL if you prefer)
Wait a short while
Actual results:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1940, in _progress_update
self.opts.progress_obj.update(downloaded)
File "/usr/lib/python3.7/site-packages/urlgrabber/progress.py", line 149, in update
self._do_update(amount_read, now)
File "/usr/lib/python3.7/site-packages/urlgrabber/progress.py", line 251, in _do_update
ave_dl = format_number(self.re.average_rate())
File "/usr/lib/python3.7/site-packages/urlgrabber/progress.py", line 785, in format_number
while number > thresh and depth < max_depth:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1580, in _do_perform
self.curl_obj.perform()
pycurl.error: (42, 'Callback aborted')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./grabber.py", line 7, in
g.urlgrab('https://download.fedoraproject.org/pub/fedora/linux/releases/31/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-31-1.9.iso')
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1256, in urlgrab
return self._retry(opts, retryfunc, url, filename)
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1145, in _retry
r = func(opts, *args)
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1241, in retryfunc
fo = PyCurlFileObject(url, filename, opts)
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1343, in init
self._do_open()
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1692, in _do_open
self._do_grab()
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1826, in _do_grab
self._do_perform()
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1615, in _do_perform
raise KeyboardInterrupt
KeyboardInterrupt
Expected results:
A nice progress bar and, after a while, an iso.
Additional info:
I got 160KiB downloaded before the error message and nothing else was displayed at all.
Although this is against Fedora31, I get the same error on Fedora 30 and using python2 instead of python3 everything works as expected both on Fedora31 and Fedora30.
The text was updated successfully, but these errors were encountered:
Initialising ave_rate to zero instead of None in RateEstimator fixes that problem. Changing "blen" to "int(blen)" in _term_add_bar() fixes the next one to show up. Both of those are in /usr/lib/python3.7/site-packages/urlgrabber/progress.py
Type errors would prevent TextMeter from being used as a
progess_option.
This commit fixes this with a type cast and an initialization of
a variable as int.
Fixesrpm-software-management#24
Type errors would prevent TextMeter from being used as a
progess_option.
This commit fixes this with a type cast and an initialization of
a variable as int.
Fixes#24
Description of problem:
Trying to use urlgrabber with a text progress meter fails with "TypeError: '>' not supported between instances of 'NoneType' and 'int'"
Version-Release number of selected component (if applicable):
python3-urlgrabber-4.0.0-4.fc31
How reproducible: Always
Steps to Reproduce:
1.
Run this program:
(use a different URL if you prefer)
Actual results:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1940, in _progress_update
self.opts.progress_obj.update(downloaded)
File "/usr/lib/python3.7/site-packages/urlgrabber/progress.py", line 149, in update
self._do_update(amount_read, now)
File "/usr/lib/python3.7/site-packages/urlgrabber/progress.py", line 251, in _do_update
ave_dl = format_number(self.re.average_rate())
File "/usr/lib/python3.7/site-packages/urlgrabber/progress.py", line 785, in format_number
while number > thresh and depth < max_depth:
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1580, in _do_perform
self.curl_obj.perform()
pycurl.error: (42, 'Callback aborted')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./grabber.py", line 7, in
g.urlgrab('https://download.fedoraproject.org/pub/fedora/linux/releases/31/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-31-1.9.iso')
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1256, in urlgrab
return self._retry(opts, retryfunc, url, filename)
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1145, in _retry
r = func(opts, *args)
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1241, in retryfunc
fo = PyCurlFileObject(url, filename, opts)
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1343, in init
self._do_open()
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1692, in _do_open
self._do_grab()
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1826, in _do_grab
self._do_perform()
File "/usr/lib/python3.7/site-packages/urlgrabber/grabber.py", line 1615, in _do_perform
raise KeyboardInterrupt
KeyboardInterrupt
Expected results:
A nice progress bar and, after a while, an iso.
Additional info:
I got 160KiB downloaded before the error message and nothing else was displayed at all.
Although this is against Fedora31, I get the same error on Fedora 30 and using python2 instead of python3 everything works as expected both on Fedora31 and Fedora30.
The text was updated successfully, but these errors were encountered: