ERROR: float division by zero
See original GitHub issueHey, I’ve noticed that I often get a divide by zero error when trying to download files.
It appears the code does not handle the case when cur_time - beg_time
is 0
Traceback (most recent call last):
File "downloader-cli\0.3.1\downloader_cli\download.py", line 376, in _download
speed, s_unit, time_left, time_unit = self._get_speed_n_time(
File "downloader-cli\0.3.1\downloader_cli\download.py", line 264, in _get_speed_n_time
speed = (file_size_dl / 1024) / (cur_time - beg_time)
ZeroDivisionError: float division by zero
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
ZeroDivisionError: float division by zero in Python | bobbyhadz
The Python "ZeroDivisionError: float division by zero" occurs when we try to divide a floating-point number by 0 . To solve the error,...
Read more >ZeroDivisionError: division by zero - Net-Informations.Com
ZeroDivisionError is a built-in Python exception thrown when a number is divided by 0. This means that the exception raised when the second...
Read more >float division by zero Python - decimal - Stack Overflow
If n is a large number then use double or decimal instead of float. It will solve division by zero issue. Updated: Here...
Read more >Python error ZeroDivisionError float division by zero - Edureka
In the above line the denominator becomes zero. A float number cannot be devided by zero. In this case the express is divided...
Read more >Floating-Point Division by Zero Error Message - MultiCharts
Floating point error means that there is a division by a zero value in your code. It can be a variable, input, or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@deepjyoti30 yep that’s fixed the issue, thanks for sorting this out so quickly 👍
@ChanceNCounter Cool then, let’s keep the conditional for now. If that seems to throw issues, we can consider the sleep one as well.