fnep/mtv_dl

Progressbar: Float division by zero

Closed this issue · 1 comments

Guten Abend

Seitdem die Progressbar mit der neuen Bibliothek (Paket rich) implementiert wurde, erscheint sporadisch diese Fehlermeldung bei einem beliebigen Download:

2020-05-17T22:05:56 CRITICAL <class 'ZeroDivisionError'>: float division by zero File "mtv_dl.py", line 1168, in <module> main() File "mtv_dl.py", line 1151, in main downloader.download(quality_preference, # type: ignore File "mtv_dl.py", line 1005, in download subtitles_xml_path = list(self._download_files(temp_path, [self.show['url_subtitles']]))[0] File "mtv_dl.py", line 814, in _download_files yield destination_file_path File "/usr/lib/python3.8/contextlib.py", line 120, in __exit__ next(self.gen) File "mtv_dl.py", line 246, in progress_bar yield progress File "/home/schui/.local/lib/python3.8/site-packages/rich/progress.py", line 420, in __exit__ self.stop() File "/home/schui/.local/lib/python3.8/site-packages/rich/progress.py", line 402, in stop self.refresh() File "/home/schui/.local/lib/python3.8/site-packages/rich/progress.py", line 550, in refresh self.console.print(self._live_render) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 720, in print extend(render(renderable, render_options)) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 495, in render yield from self._render(renderable, options or self.options) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 471, in _render for render_output in iter_render: File "/home/schui/.local/lib/python3.8/site-packages/rich/live_render.py", line 35, in __console__ lines = console.render_lines(self.renderable, options, style, pad=False) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 523, in render_lines lines = list( File "/home/schui/.local/lib/python3.8/site-packages/rich/segment.py", line 110, in split_and_crop_lines for segment in segments: File "/home/schui/.local/lib/python3.8/site-packages/rich/segment.py", line 65, in <genexpr> return ( File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 495, in render yield from self._render(renderable, options or self.options) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 475, in _render yield from self.render(render_output, render_options) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 495, in render yield from self._render(renderable, options or self.options) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 471, in _render for render_output in iter_render: File "/home/schui/.local/lib/python3.8/site-packages/rich/table.py", line 324, in __console__ yield from self._render(console, options, widths) File "/home/schui/.local/lib/python3.8/site-packages/rich/table.py", line 488, in _render lines = console.render_lines( File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 523, in render_lines lines = list( File "/home/schui/.local/lib/python3.8/site-packages/rich/segment.py", line 110, in split_and_crop_lines for segment in segments: File "/home/schui/.local/lib/python3.8/site-packages/rich/segment.py", line 65, in <genexpr> return ( File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 495, in render yield from self._render(renderable, options or self.options) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 471, in _render for render_output in iter_render: File "/home/schui/.local/lib/python3.8/site-packages/rich/padding.py", line 83, in __console__ lines = console.render_lines(self.renderable, child_options, style=style) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 523, in render_lines lines = list( File "/home/schui/.local/lib/python3.8/site-packages/rich/segment.py", line 110, in split_and_crop_lines for segment in segments: File "/home/schui/.local/lib/python3.8/site-packages/rich/segment.py", line 65, in <genexpr> return ( File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 495, in render yield from self._render(renderable, options or self.options) File "/home/schui/.local/lib/python3.8/site-packages/rich/console.py", line 471, in _render for render_output in iter_render: File "/home/schui/.local/lib/python3.8/site-packages/rich/bar.py", line 65, in __console__ complete_halves = int(width * 2 * completed / self.total)

Aktuelles Beispielt wäre: 2020-05-17T22:39:26 INFO Saved show 'Extra 3 vom 13.05.2020 mit Christian Ehring' (ARD, 'extra 3', 2020-05-13 21:10:00, 39190c75c9c)
Danke für den Fix.
Gruss schui95

fnep commented

Toll, Danke dass du so fleißig testest. Guck ich mir direkt mal an.